aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2019-04-17 10:30:32 -0400
committerMarcoFalke <[email protected]>2019-04-17 10:30:38 -0400
commite2b5fdee006889391ddae2107ddf29eccdfc2015 (patch)
treef3eeaa6ec0391faf16df75772736ebc5899692f2 /src/rpc/blockchain.cpp
parentMerge #15352: tests: Reduce noise level in test_bitcoin output (diff)
parentrest/rpc: Make mempoolinfo atomic (diff)
downloaddiscoin-e2b5fdee006889391ddae2107ddf29eccdfc2015.tar.xz
discoin-e2b5fdee006889391ddae2107ddf29eccdfc2015.zip
Merge #15474: rest/rpc: Make mempoolinfo atomic
e377846ff1 rest/rpc: Make mempoolinfo atomic (João Barbosa) Pull request description: Make `/rest/mempool/info.json` endpoint and `getmempoolinfo` RPC atomic. ACKs for commit e37784: Tree-SHA512: 6b40844df813e180d68731fc263bd9a2c2a01fe143a4f5a8974e3e0023e6e2e1e9bc46669ddfdf44f0e47142feda2a2aad1ea02ef8837081e11522347f314b0b
Diffstat (limited to 'src/rpc/blockchain.cpp')
-rw-r--r--src/rpc/blockchain.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 3db24080d..1cc496c73 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -1487,6 +1487,8 @@ static UniValue getchaintips(const JSONRPCRequest& request)
UniValue MempoolInfoToJSON(const CTxMemPool& pool)
{
+ // Make sure this call is atomic in the pool.
+ LOCK(pool.cs);
UniValue ret(UniValue::VOBJ);
ret.pushKV("size", (int64_t)pool.size());
ret.pushKV("bytes", (int64_t)pool.GetTotalTxSize());