Skip to content

Commit

Permalink
bitcoin.rs sign_refund: fix input signing for non-coop refund
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 committed Oct 16, 2024
1 parent edf9765 commit 368d31c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/swaps/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,12 @@ impl BtcSwapTx {
"Control block calculation failed".to_string(),
))?;

// Input sequence has to be set for all inputs before signing
for input_index in 0..refund_tx.input.len() {
refund_tx.input[input_index].sequence = Sequence::ZERO;
}

for input_index in 0..refund_tx.input.len() {
let sighash = SighashCache::new(refund_tx.clone())
.taproot_script_spend_signature_hash(
input_index,
Expand Down

0 comments on commit 368d31c

Please sign in to comment.