diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-02-25 15:09:24 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-03-08 16:25:04 +0000 |
commit | e377846ff1e718961148e64ff73e891b24f37ed6 (patch) | |
tree | 140d9907a1c9cd42cb83954fe265d73817837fc1 /src/rpc | |
parent | efed9809b4fab34e33c3012aa3cf4b7a75d98ead (diff) | |
download | bitcoin-e377846ff1e718961148e64ff73e891b24f37ed6.tar.xz |
rest/rpc: Make mempoolinfo atomic
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/blockchain.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 1827aec637..0eea269375 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1483,6 +1483,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()); |