Skip to content

Commit e0f0f5c

Browse files
committed
sweep: skip wallet inputs in isThirdPartySpent
1 parent a50cdd6 commit e0f0f5c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sweep/fee_bumper.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -1039,13 +1039,24 @@ func (t *TxPublisher) isThirdPartySpent(txid chainhash.Hash,
10391039
for _, inp := range inputs {
10401040
op := inp.OutPoint()
10411041

1042+
// For wallet utxos, the height hint is not set - we don't need
1043+
// to monitor them for third party spend.
1044+
heightHint := inp.HeightHint()
1045+
if heightHint == 0 {
1046+
log.Debugf("Skipped third party check for wallet "+
1047+
"input %v", op)
1048+
1049+
continue
1050+
}
1051+
10421052
// If the input has already been spent after the height hint, a
10431053
// spend event is sent back immediately.
10441054
spendEvent, err := t.cfg.Notifier.RegisterSpendNtfn(
1045-
&op, inp.SignDesc().Output.PkScript, inp.HeightHint(),
1055+
&op, inp.SignDesc().Output.PkScript, heightHint,
10461056
)
10471057
if err != nil {
1048-
log.Criticalf("Failed to register spend ntfn: %v", err)
1058+
log.Criticalf("Failed to register spend ntfn for "+
1059+
"input=%v: %v", op, err)
10491060
return false
10501061
}
10511062

0 commit comments

Comments
 (0)