From e17cbadccb2655fa1e127461ad4d52e9c90270ce Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 16 Mar 2021 19:09:06 +1100 Subject: [PATCH] Don't add signatures to transaction unless necessary In order to compute the cancel TxID, we don't need to add the signatures. --- swap/src/protocol/bob/state.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/swap/src/protocol/bob/state.rs b/swap/src/protocol/bob/state.rs index 1588df50..46092393 100644 --- a/swap/src/protocol/bob/state.rs +++ b/swap/src/protocol/bob/state.rs @@ -437,17 +437,6 @@ impl State4 { let tx_cancel = bitcoin::TxCancel::new(&self.tx_lock, self.cancel_timelock, self.A, self.b.public()); - let sig_a = self.tx_cancel_sig_a.clone(); - let sig_b = self.b.sign(tx_cancel.digest()); - - let tx_cancel = tx_cancel - .clone() - .add_signatures((self.A, sig_a), (self.b.public(), sig_b)) - .expect( - "sig_{a,b} to be valid signatures for - tx_cancel", - ); - let tx = bitcoin_wallet.get_raw_transaction(tx_cancel.txid()).await?; Ok(tx)