aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-04-17 10:30:32 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-04-17 10:30:38 -0400
commite2b5fdee006889391ddae2107ddf29eccdfc2015 (patch)
treef3eeaa6ec0391faf16df75772736ebc5899692f2 /src/rpc
parent0c9de67f343c0e740a7f488e85270d519a352119 (diff)
parente377846ff1e718961148e64ff73e891b24f37ed6 (diff)
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')
-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 3db24080db..1cc496c733 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());