From bb836418db9502604ec07fff73cbf888778ed283 Mon Sep 17 00:00:00 2001 From: Nick Vincent Date: Thu, 9 Jan 2025 01:21:07 -0500 Subject: [PATCH] =?UTF-8?q?fix=20=F0=9F=90=9B:=20witness=20length=20overri?= =?UTF-8?q?de=20set=20for=20testnet=20on=20auxpow=20override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUE: #60 --- app/src/chain.rs | 3 ++- crates/federation/src/bitcoin_signing.rs | 5 ++++- crates/federation/src/lib.rs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/chain.rs b/app/src/chain.rs index 55a7c55..8fe82aa 100644 --- a/app/src/chain.rs +++ b/app/src/chain.rs @@ -544,7 +544,8 @@ impl> Chain { let wallet = self.bitcoin_wallet.read().await; trace!("Checking signature for finalized pegout {:?}", tx.txid()); - wallet.check_transaction_signatures(tx)?; + // NOTE: same as auxpow_override + wallet.check_transaction_signatures(tx, pow_override)?; } } else { trace!("Block does not have PoW"); diff --git a/crates/federation/src/bitcoin_signing.rs b/crates/federation/src/bitcoin_signing.rs index c4b336e..163cd0c 100644 --- a/crates/federation/src/bitcoin_signing.rs +++ b/crates/federation/src/bitcoin_signing.rs @@ -330,7 +330,10 @@ impl UtxoManager { Ok(messages) } - pub fn check_transaction_signatures(&self, transaction: &Transaction) -> Result<(), Error> { + pub fn check_transaction_signatures(&self, transaction: &Transaction, witness_len_override: bool) -> Result<(), Error> { + if witness_len_override { + return Ok(()); + } let signing_messages = self.get_signing_inputs(transaction)?; for (msg, input) in signing_messages.iter().zip(transaction.input.iter()) { let witnesses = input.witness.to_vec(); diff --git a/crates/federation/src/lib.rs b/crates/federation/src/lib.rs index 62fecfb..a1975d0 100644 --- a/crates/federation/src/lib.rs +++ b/crates/federation/src/lib.rs @@ -488,7 +488,7 @@ mod tests { // Check the tx { - wallet.check_transaction_signatures(&signed_tx).unwrap(); + wallet.check_transaction_signatures(&signed_tx, false).unwrap(); } // Use bitcoin-core to send the tx, to see if it works