sweep: cancel rebroadcasting of failed/replaced/confirmed txns

This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:32 +08:00
1 parent 106b97ce33
commit fce86f9b22
2 files changed
+34 -2

No files matched your search

+6
View File
@@ -1622,6 +1622,9 @@ func (s *UtxoSweeper) monitorFeeBumpResult(resultChan <-chan *BumpResult) {
"fee bump monitor", r.Event,
r.Tx.TxHash())
// Cancel the rebroadcasting of the failed tx.
s.cfg.Wallet.CancelRebroadcast(r.Tx.TxHash())
return
}
@@ -1673,6 +1676,9 @@ func (s *UtxoSweeper) handleBumpEventTxReplaced(r *BumpResult) error {
return err
}
// Cancel the rebroadcasting of the replaced tx.
s.cfg.Wallet.CancelRebroadcast(oldTxid)
log.Infof("RBFed tx=%v(fee=%v sats, feerate=%v sats/kw) with new "+
"tx=%v(fee=%v, "+"feerate=%v)", record.Txid, record.Fee,
record.FeeRate, tr.Txid, tr.Fee, tr.FeeRate)