Skip to content

Commit e377846

Browse files
committed
rest/rpc: Make mempoolinfo atomic
1 parent efed980 commit e377846

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
@@ -1483,6 +1483,8 @@ static UniValue getchaintips(const JSONRPCRequest& request)
14831483

14841484
UniValue MempoolInfoToJSON(const CTxMemPool& pool)
14851485
{
1486+
// Make sure this call is atomic in the pool.
1487+
LOCK(pool.cs);
14861488
UniValue ret(UniValue::VOBJ);
14871489
ret.pushKV("size", (int64_t)pool.size());
14881490
ret.pushKV("bytes", (int64_t)pool.GetTotalTxSize());

0 commit comments

Comments
 (0)