rest/rpc: Make mempoolinfo atomic

This commit is contained in:
João Barbosa committed 2019-03-08 16:25:04 +00:00
1 parent efed9809b4
commit e377846ff1
1 file changed
+2
+2
View File
@@ -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());