Skip to content

Commit 74e83ea

Browse files
committed
tapchannel: ensure the prev witness prev ID is set for 2nd level spends
Otherwise, we'll still be pointing to the wrong asset UTXO, even though the vIn was updated.
1 parent 54a6979 commit 74e83ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tapchannel/aux_sweeper.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,12 @@ func (a *AuxSweeper) registerAndBroadcastSweep(req *sweep.BumpRequest,
22082208
for _, vIn := range vPkt.Inputs {
22092209
vIn.PrevID.OutPoint = sweepSet.btcInput.OutPoint()
22102210
}
2211+
for _, vOut := range vPkt.Outputs {
2212+
vOut.Asset.PrevWitnesses[0].PrevID.OutPoint = sweepSet.btcInput.OutPoint()
2213+
}
2214+
}
2215+
}
2216+
22112217
// For pre-signed HTLC txns we'll need to make sure we update the output
22122218
// index in the vPkt. As the ordering is only determined at broadcast
22132219
// time.

0 commit comments

Comments
 (0)