aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-05-17 16:30:00 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-05-30 12:23:44 +0900
commite9a1881b90704c6708cfba79d2208debbd4476d0 (patch)
tree0fd589c336747139b3012995e183935023965f02 /src/validation.h
parentf8a29ca823fba7fc0eb63896ac4d3d5a0093a023 (diff)
refactor: add a function for determining if a block is pruned or not
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h
index b5ab10786a..04f5b6cb80 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -497,4 +497,10 @@ bool DumpMempool();
/** Load the mempool from disk. */
bool LoadMempool();
+//! Check whether the block associated with this index entry is pruned or not.
+inline bool IsBlockPruned(const CBlockIndex* pblockindex)
+{
+ return (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0);
+}
+
#endif // BITCOIN_VALIDATION_H