Skip to content

Commit 3d93250

Browse files
committed
f - simplify pushing sig on tx
1 parent 4b53c17 commit 3d93250

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,11 +2818,9 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
28182818
self.counterparty_commitment_params.on_counterparty_tx_csv, &delayed_key);
28192819

28202820
let sig = self.onchain_tx_handler.signer.sign_justice_revoked_output(&justice_tx, input_idx, value, &per_commitment_key, &self.onchain_tx_handler.secp_ctx)?;
2821-
let mut ser_sig = sig.serialize_der().to_vec();
2822-
ser_sig.push(EcdsaSighashType::All as u8);
2823-
justice_tx.input[input_idx].witness.push(ser_sig);
2824-
justice_tx.input[input_idx].witness.push(vec!(1));
2825-
justice_tx.input[input_idx].witness.push(revokeable_redeemscript.clone().into_bytes());
2821+
justice_tx.input[input_idx].witness.push_bitcoin_signature(&sig.serialize_der(), EcdsaSighashType::All);
2822+
justice_tx.input[input_idx].witness.push(&[1u8]);
2823+
justice_tx.input[input_idx].witness.push(revokeable_redeemscript.clone().as_bytes());
28262824
Ok(justice_tx)
28272825
}
28282826

0 commit comments

Comments
 (0)