Make CHash256 and CHash160 consume Spans

This commit is contained in:
Pieter Wuille
2020-06-18 16:32:32 -07:00
parent 2a2182c387
commit e549bf8a9a
16 changed files with 32 additions and 32 deletions

View File

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