Make CHash256/CHash160 output to Span

This commit is contained in:
Pieter Wuille
2020-06-18 17:19:46 -07:00
parent 0ef97b1b10
commit 02c4cc5c5d
13 changed files with 28 additions and 26 deletions

View File

@@ -282,7 +282,7 @@ public:
CScript scriptPubKey = script;
if (wm == WitnessMode::PKH) {
uint160 hash;
CHash160().Write(MakeSpan(script).subspan(1)).Finalize(hash.begin());
CHash160().Write(MakeSpan(script).subspan(1)).Finalize(hash);
script = CScript() << OP_DUP << OP_HASH160 << ToByteVector(hash) << OP_EQUALVERIFY << OP_CHECKSIG;
scriptPubKey = CScript() << witnessversion << ToByteVector(hash);
} else if (wm == WitnessMode::SH) {