Skip to content

Commit 6361dbd

Browse files
JoeGruffinsvboxuser
authored andcommitted
core: Send deferred redeem notification for gasless redeems.
When a GaslessRedeem UserOp is used, the redeem notification to the server was never sent because submitted=false deferred the notification, but the deferred send was never implemented. Send the notification when ConfirmRedemption reports the real transaction hash after the bundler submits.
1 parent 00397f5 commit 6361dbd

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

client/core/trade.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,6 +3537,17 @@ func (c *Core) confirmTx(t *trackedTrade, match *matchTracker, info *txInfo) (bo
35373537
t.notify(note)
35383538
}
35393539

3540+
// If this is a redeem that was pending submission (e.g. a
3541+
// GaslessRedeem UserOp), the bundler has now submitted the
3542+
// transaction and we have the real coin ID. Send the deferred
3543+
// redeem notification to the server.
3544+
if info.txType == asset.CTRedeem && match.redemptionPendingSubmission && !status.PendingSubmission {
3545+
match.redemptionPendingSubmission = false
3546+
if !match.matchCompleteSent {
3547+
c.sendRedeemAsync(t, match, status.CoinID, match.MetaData.Proof.Secret)
3548+
}
3549+
}
3550+
35403551
if confirmed {
35413552
subject, details := t.formatDetails(info.confirmedTopic, match.token(), makeOrderToken(t.token()))
35423553
note := newMatchNote(info.confirmedTopic, subject, details, db.Success, t, match)

0 commit comments

Comments
 (0)