From b048569f64b87ca1500e8a5e5aa989c122583d92 Mon Sep 17 00:00:00 2001 From: einliterflasche Date: Wed, 11 Dec 2024 06:27:09 +0100 Subject: [PATCH] fix: use p2wsh_signature_hash instead of p2wpkh_signature_hash --- swap/src/bitcoin/redeem.rs | 2 +- swap/src/bitcoin/refund.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/bitcoin/redeem.rs b/swap/src/bitcoin/redeem.rs index 166ba3cd4..c08525a24 100644 --- a/swap/src/bitcoin/redeem.rs +++ b/swap/src/bitcoin/redeem.rs @@ -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(), diff --git a/swap/src/bitcoin/refund.rs b/swap/src/bitcoin/refund.rs index 24418be49..122868007 100644 --- a/swap/src/bitcoin/refund.rs +++ b/swap/src/bitcoin/refund.rs @@ -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