Don't add signatures to transaction unless necessary

In order to compute the cancel TxID, we don't need to add the
signatures.
This commit is contained in:
Thomas Eizinger 2021-03-16 19:09:06 +11:00
parent 6beb732e35
commit e17cbadccb
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

View File

@ -437,17 +437,6 @@ impl State4 {
let tx_cancel = let tx_cancel =
bitcoin::TxCancel::new(&self.tx_lock, self.cancel_timelock, self.A, self.b.public()); 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?; let tx = bitcoin_wallet.get_raw_transaction(tx_cancel.txid()).await?;
Ok(tx) Ok(tx)