Skip to content

Commit

Permalink
Add Abandon support
Browse files Browse the repository at this point in the history
  • Loading branch information
dimriou committed Dec 2, 2024
1 parent bb18095 commit 6bc27a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type TxmV2Wrapper[
] interface {
services.Service
CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error)
Reset(addr ADDR, abandon bool) error
}

type reset struct {
Expand Down Expand Up @@ -259,6 +260,11 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) Reset(addr
f := func() {
if abandon {
err = b.abandon(addr)
if b.txmv2wrapper != nil {
if err2 := b.txmv2wrapper.Reset(addr, abandon); err2 != nil {
b.logger.Error("failed to abandon transactions for dual broadcast", "err", err2)
}
}
}
}

Expand Down

0 comments on commit 6bc27a2

Please sign in to comment.