Skip to content

Commit

Permalink
fix 🐛: witness length override set for testnet on auxpow override
Browse files Browse the repository at this point in the history
ISSUE: #60
  • Loading branch information
emailnjv committed Jan 9, 2025
1 parent 9de2ba5 commit bb83641
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@ impl<DB: ItemStore<MainnetEthSpec>> Chain<DB> {

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");
Expand Down
5 changes: 4 additions & 1 deletion crates/federation/src/bitcoin_signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ impl<T: Database> UtxoManager<T> {
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();
Expand Down
2 changes: 1 addition & 1 deletion crates/federation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb83641

Please sign in to comment.