From dd6687d9929557618226145802e0db5f5eb398b7 Mon Sep 17 00:00:00 2001 From: planetBoy <140164174+Guayaba221@users.noreply.github.com> Date: Sun, 16 Mar 2025 16:13:21 +0100 Subject: [PATCH 1/2] Update sighash.rs --- bitcoin/examples/sighash.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/examples/sighash.rs b/bitcoin/examples/sighash.rs index e4bf819ef..0878ea439 100644 --- a/bitcoin/examples/sighash.rs +++ b/bitcoin/examples/sighash.rs @@ -57,7 +57,7 @@ fn compute_sighash_p2wpkh(raw_tx: &[u8], inp_idx: usize, amount: Amount) { /// # Parameters /// /// * `raw_tx` - spending tx hex -/// * `inp_idx` - spending tx input inde +/// * `inp_idx` - spending tx input index /// * `script_pubkey_bytes_opt` - Option with scriptPubKey bytes. If None, it's p2sh case, i.e., reftx output's scriptPubKey.type is "scripthash". In this case scriptPubkey is extracted from the spending transaction's scriptSig. If Some(), it's p2ms case, i.e., reftx output's scriptPubKey.type is "multisig", and the scriptPubkey is supplied from the referenced output. fn compute_sighash_legacy(raw_tx: &[u8], inp_idx: usize, script_pubkey_bytes_opt: Option<&[u8]>) { let tx: Transaction = consensus::deserialize(raw_tx).unwrap(); From 441e173792fa97fb6f8bf991e6c195da8d8f1a51 Mon Sep 17 00:00:00 2001 From: planetBoy <140164174+Guayaba221@users.noreply.github.com> Date: Sun, 16 Mar 2025 16:14:13 +0100 Subject: [PATCH 2/2] Update owned.rs --- bitcoin/src/blockdata/script/owned.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/src/blockdata/script/owned.rs b/bitcoin/src/blockdata/script/owned.rs index ccc82ca89..8b8b73e38 100644 --- a/bitcoin/src/blockdata/script/owned.rs +++ b/bitcoin/src/blockdata/script/owned.rs @@ -203,7 +203,7 @@ impl<'a> Extend> for ScriptBuf { /// Pretends that this is a mutable reference to [`ScriptBuf`]'s internal buffer. /// /// In reality the backing `Vec` is swapped with an empty one and this is holding both the -/// reference and the vec. The vec is put back when this drops so it also covers paics. (But not +/// reference and the vec. The vec is put back when this drops so it also covers panics. (But not /// leaks, which is OK since we never leak.) pub(crate) struct ScriptBufAsVec<'a>(&'a mut ScriptBuf, Vec);