diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-05-01 10:06:11 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-05-01 10:06:15 -0400 |
commit | 12aa2ac988d0ccb21019a20b109e018cf31b78cf (patch) | |
tree | 9523fe3a8cdd1756eb49bf0b1541c0aa88270105 /src/validation.h | |
parent | 86edb79e9758222c489da174afa0229e2ecad660 (diff) | |
parent | effe81f7503d2ca3c88cfdea687f9f997f353e0d (diff) |
Merge #15323: rpc: Expose g_is_mempool_loaded via getmempoolinfo
effe81f750 Move g_is_mempool_loaded into CTxMemPool::m_is_loaded (Ben Woosley)
bb8ae2c419 rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json (Ben Woosley)
Pull request description:
And use it to fix a race condition in mempool_persist.py:
https://travis-ci.org/Empact/bitcoin/jobs/487577243
Since e.g. getrawmempool returns errors based on this status, this
enables users to test it for readiness.
Fixes #12863
ACKs for commit effe81:
MarcoFalke:
utACK effe81f750
jnewbery:
utACK effe81f7503d2ca3c88cfdea687f9f997f353e0d
Tree-SHA512: 74328b0c17a97efb8a000d4ee49b9a673c2b6dde7ea30c43a6a2eff961a233351c9471f9a42344412135786c02bdf2ee1b2526651bb8fed68bd94d2120c4ef86
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/validation.h b/src/validation.h index 61a7a270fc..7ab6adaf33 100644 --- a/src/validation.h +++ b/src/validation.h @@ -142,7 +142,6 @@ extern CScript COINBASE_FLAGS; extern CCriticalSection cs_main; extern CBlockPolicyEstimator feeEstimator; extern CTxMemPool mempool; -extern std::atomic_bool g_is_mempool_loaded; typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap; extern BlockMap& mapBlockIndex GUARDED_BY(cs_main); extern Mutex g_best_block_mutex; @@ -474,10 +473,10 @@ static const unsigned int REJECT_HIGHFEE = 0x100; CBlockFileInfo* GetBlockFileInfo(size_t n); /** Dump the mempool to disk. */ -bool DumpMempool(); +bool DumpMempool(const CTxMemPool& pool); /** Load the mempool from disk. */ -bool LoadMempool(); +bool LoadMempool(CTxMemPool& pool); //! Check whether the block associated with this index entry is pruned or not. inline bool IsBlockPruned(const CBlockIndex* pblockindex) |