aboutsummaryrefslogtreecommitdiff
path: root/src/blockencodings.cpp
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2023-01-16 16:13:52 +0100
committerdergoegge <n.goeggi@gmail.com>2023-01-23 17:18:35 +0100
commit1429f8377017c0029cb87c4d355c37b796432611 (patch)
tree5ee91a8932ba3d8faa9e1c849aaf23781f78aade /src/blockencodings.cpp
parentdbca00ef76e5a004555dbd4cdc9209492f02e358 (diff)
[block encodings] Make CheckBlock mockable for PartiallyDownloadedBlock
Diffstat (limited to 'src/blockencodings.cpp')
-rw-r--r--src/blockencodings.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp
index bcb86d75cc..c83e893c0e 100644
--- a/src/blockencodings.cpp
+++ b/src/blockencodings.cpp
@@ -197,7 +197,8 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
return READ_STATUS_INVALID;
BlockValidationState state;
- if (!CheckBlock(block, state, Params().GetConsensus())) {
+ CheckBlockFn check_block = m_check_block_mock ? m_check_block_mock : CheckBlock;
+ if (!check_block(block, state, Params().GetConsensus(), /*fCheckPoW=*/true, /*fCheckMerkleRoot=*/true)) {
// TODO: We really want to just check merkle tree manually here,
// but that is expensive, and CheckBlock caches a block's
// "checked-status" (in the CBlock?). CBlock should be able to