sweep: add new state TxFatal for erroneous sweepings

Also updated the loggings. This new state will be used in the following
commit.
This commit is contained in:
yyforyongyu authored and yyforyongyu committed 2024-12-20 17:53:58 +08:00
1 parent 1dfb5a0c20
commit 6c2e8b9a00
3 files changed
+68 -16

No files matched your search

+4 -1
View File
@@ -1729,7 +1729,7 @@ func (s *UtxoSweeper) handleBumpEventTxPublished(r *BumpResult) error {
// NOTE: TxConfirmed event is not handled, since we already subscribe to the
// input's spending event, we don't need to do anything here.
func (s *UtxoSweeper) handleBumpEvent(r *BumpResult) error {
log.Debugf("Received bump event [%v] for tx %v", r.Event, r.Tx.TxHash())
log.Debugf("Received bump result %v", r)
switch r.Event {
// The tx has been published, we update the inputs' state and create a
@@ -1745,6 +1745,9 @@ func (s *UtxoSweeper) handleBumpEvent(r *BumpResult) error {
// with the new one.
case TxReplaced:
return s.handleBumpEventTxReplaced(r)
case TxFatal:
// TODO(yy): create a method to remove this input.
}
return nil