diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-06-18 16:32:32 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-07-30 13:57:53 -0700 |
commit | e549bf8a9afae42fcda805e216a1cde62df195a6 (patch) | |
tree | 2d00e10ead84a3162f7ddc74300dcfbd340853a4 /src/validation.cpp | |
parent | 2a2182c387f607cd8284f33890bd285a81077b7f (diff) |
Make CHash256 and CHash160 consume Spans
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 3cebf1090e..4e64455cb5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3434,7 +3434,7 @@ std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBloc if (consensusParams.SegwitHeight != std::numeric_limits<int>::max()) { if (commitpos == -1) { uint256 witnessroot = BlockWitnessMerkleRoot(block, nullptr); - CHash256().Write(witnessroot.begin(), 32).Write(ret.data(), 32).Finalize(witnessroot.begin()); + CHash256().Write(witnessroot).Write(ret).Finalize(witnessroot.begin()); CTxOut out; out.nValue = 0; out.scriptPubKey.resize(MINIMUM_WITNESS_COMMITMENT); @@ -3579,7 +3579,7 @@ static bool ContextualCheckBlock(const CBlock& block, BlockValidationState& stat if (block.vtx[0]->vin[0].scriptWitness.stack.size() != 1 || block.vtx[0]->vin[0].scriptWitness.stack[0].size() != 32) { return state.Invalid(BlockValidationResult::BLOCK_MUTATED, "bad-witness-nonce-size", strprintf("%s : invalid witness reserved value size", __func__)); } - CHash256().Write(hashWitness.begin(), 32).Write(&block.vtx[0]->vin[0].scriptWitness.stack[0][0], 32).Finalize(hashWitness.begin()); + CHash256().Write(hashWitness).Write(block.vtx[0]->vin[0].scriptWitness.stack[0]).Finalize(hashWitness.begin()); if (memcmp(hashWitness.begin(), &block.vtx[0]->vout[commitpos].scriptPubKey[6], 32)) { return state.Invalid(BlockValidationResult::BLOCK_MUTATED, "bad-witness-merkle-match", strprintf("%s : witness merkle commitment mismatch", __func__)); } |