aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2014-10-20 02:10:03 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2014-11-18 19:20:10 +0000
commitdf08a626e0440457ae0d1966439fd956c27ae2fe (patch)
tree586501914259b6303dab55bd719efb1be76d5df4 /src/main.h
parent4ea1be7fb84a397222754473c2bc315e3665ff18 (diff)
downloadbitcoin-df08a626e0440457ae0d1966439fd956c27ae2fe.tar.xz
TestBlockValidity function for CBlock proposals (used by CreateNewBlock)
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index 6e684be8c0..b49f0a06eb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -457,7 +457,7 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex);
bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool* pfClean = NULL);
// Apply the effects of this block (with given index) on the UTXO set represented by coins
-bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false);
+bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& coins, bool fJustCheck = false);
// Context-independent validity checks
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW = true);
@@ -467,6 +467,9 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW = t
bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex *pindexPrev);
bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex *pindexPrev);
+// Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held)
+bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex *pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
+
// Store block on disk
// if dbp is provided, the file is known to already reside on disk
bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL);