aboutsummaryrefslogtreecommitdiff
path: root/src/script/sign.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-07-22 08:36:00 +0100
committerfanquake <fanquake@gmail.com>2022-07-22 08:40:36 +0100
commit510ac41eac068d58fd0cedf2e8f99f8c7ef533aa (patch)
tree338c49011a4b0a6d463c93579cc0baddda1c936a /src/script/sign.cpp
parent86133df7a2be80203fa439bf344e1f45dc2be41d (diff)
parentfaf9accd662974a69390213fee1b5c6237846b42 (diff)
Merge bitcoin/bitcoin#25331: Add HashWriter without ser-type and ser-version and use it where possible
faf9accd662974a69390213fee1b5c6237846b42 Use HashWriter where possible (MacroFake) faa5425629d35708326b255570c51139aef0c8c4 Add HashWriter without ser-type and ser-version (MacroFake) Pull request description: This was done in the context of https://github.com/bitcoin/bitcoin/pull/25284 , but I think it also makes sense standalone. The basic idea is that serialization type should not be initialized when it is not needed. Same for the serialization version. So do this here for `HashWriter`. `CHashWriter` remains in places where it is not yet possible. ACKs for top commit: sipa: utACK faf9accd662974a69390213fee1b5c6237846b42 Empact: utACK https://github.com/bitcoin/bitcoin/pull/25331/commits/faf9accd662974a69390213fee1b5c6237846b42 Tree-SHA512: 544cc712436e49f6e608120bcd3ddc5ea72dd236554ce30fb6cfff34a92d7e67b6e6527336ad0f5b6365e2b2884f4c6508aef775953ccd9312f17752729703f2
Diffstat (limited to 'src/script/sign.cpp')
-rw-r--r--src/script/sign.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index a3681d26cc..3b8071d9d1 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -165,7 +165,7 @@ static bool SignTaprootScript(const SigningProvider& provider, const BaseSignatu
if (leaf_version != TAPROOT_LEAF_TAPSCRIPT) return false;
SigVersion sigversion = SigVersion::TAPSCRIPT;
- uint256 leaf_hash = (CHashWriter(HASHER_TAPLEAF) << uint8_t(leaf_version) << script).GetSHA256();
+ uint256 leaf_hash = (HashWriter{HASHER_TAPLEAF} << uint8_t(leaf_version) << script).GetSHA256();
// <xonly pubkey> OP_CHECKSIG
if (script.size() == 34 && script[33] == OP_CHECKSIG && script[0] == 0x20) {