Skip to content

Commit

Permalink
fix: use p2wsh_signature_hash instead of p2wpkh_signature_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Einliterflasche committed Dec 11, 2024
1 parent 556d161 commit b048569
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion swap/src/bitcoin/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl TxRedeem {
let tx_redeem = tx_lock.build_spend_transaction(redeem_address, None, spending_fee);

let digest = SighashCache::new(&tx_redeem)
.p2wpkh_signature_hash(
.p2wsh_signature_hash(
0, // Only one input: lock_input (lock transaction)
&tx_lock.output_descriptor.script_code().expect("scriptcode"),
tx_lock.lock_amount(),
Expand Down
2 changes: 1 addition & 1 deletion swap/src/bitcoin/refund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl TxRefund {
let tx_refund = tx_cancel.build_spend_transaction(refund_address, None, spending_fee);

let digest = SighashCache::new(&tx_refund)
.p2wpkh_signature_hash(
.p2wsh_signature_hash(
0, // Only one input: cancel transaction
&tx_cancel
.output_descriptor
Expand Down

0 comments on commit b048569

Please sign in to comment.