Skip to content

Commit e2b5fde

Browse files
author
MarcoFalke
committed
Merge #15474: rest/rpc: Make mempoolinfo atomic
e377846 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
2 parents 0c9de67 + e377846 commit e2b5fde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpc/blockchain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,8 @@ static UniValue getchaintips(const JSONRPCRequest& request)
14871487

14881488
UniValue MempoolInfoToJSON(const CTxMemPool& pool)
14891489
{
1490+
// Make sure this call is atomic in the pool.
1491+
LOCK(pool.cs);
14901492
UniValue ret(UniValue::VOBJ);
14911493
ret.pushKV("size", (int64_t)pool.size());
14921494
ret.pushKV("bytes", (int64_t)pool.GetTotalTxSize());

0 commit comments

Comments
 (0)