aboutsummaryrefslogtreecommitdiff
path: root/src/blockencodings.h
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.h
parentdbca00ef76e5a004555dbd4cdc9209492f02e358 (diff)
[block encodings] Make CheckBlock mockable for PartiallyDownloadedBlock
Diffstat (limited to 'src/blockencodings.h')
-rw-r--r--src/blockencodings.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/blockencodings.h b/src/blockencodings.h
index e60c1e3db4..7207ff1ae2 100644
--- a/src/blockencodings.h
+++ b/src/blockencodings.h
@@ -7,8 +7,13 @@
#include <primitives/block.h>
+#include <functional>
class CTxMemPool;
+class BlockValidationState;
+namespace Consensus {
+struct Params;
+};
// Transaction compression schemes for compact block relay can be introduced by writing
// an actual formatter here.
@@ -129,6 +134,11 @@ protected:
const CTxMemPool* pool;
public:
CBlockHeader header;
+
+ // Can be overriden for testing
+ using CheckBlockFn = std::function<bool(const CBlock&, BlockValidationState&, const Consensus::Params&, bool, bool)>;
+ CheckBlockFn m_check_block_mock{nullptr};
+
explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}
// extra_txn is a list of extra transactions to look at, in <witness hash, reference> form