Skip to content

Commit

Permalink
use shorter timeouts for init/redeem requests
Browse files Browse the repository at this point in the history
  • Loading branch information
itswisdomagain committed Jan 13, 2021
1 parent b366f47 commit 54c5d4c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/core/trade.go
Original file line number Diff line number Diff line change
Expand Up @@ -1487,9 +1487,9 @@ func (c *Core) sendInitAsync(t *trackedTrade, match *matchTracker, coinID, contr
CoinID: coinID,
Contract: contract,
}
// The DEX may wait up to its configured broadcast timeout to locate the
// contract txn, so wait at least that long for a response.
timeout := t.broadcastTimeout()
// The DEX may wait up to its configured broadcast timeout, but we will
// retry on timeout or other error.
timeout := t.broadcastTimeout() / 4
err = t.dc.signAndRequest(init, msgjson.InitRoute, ack, timeout)
if err != nil {
err = fmt.Errorf("error sending 'init' message: %v", err)
Expand Down Expand Up @@ -1675,9 +1675,9 @@ func (c *Core) sendRedeemAsync(t *trackedTrade, match *matchTracker, coinID, sec
Secret: secret,
}
ack := new(msgjson.Acknowledgement)
// The DEX may wait up to its configured broadcast timeout to locate the
// redemption txn, so wait at least that long for a response.
timeout := t.broadcastTimeout()
// The DEX may wait up to its configured broadcast timeout, but we will
// retry on timeout or other error.
timeout := t.broadcastTimeout() / 4
err = t.dc.signAndRequest(msgRedeem, msgjson.RedeemRoute, ack, timeout)
if err != nil {
err = fmt.Errorf("error sending 'redeem' message: %v", err)
Expand Down

0 comments on commit 54c5d4c

Please sign in to comment.