Merge 2d16fb7a2b into merged_master (Bitcoin PR #14984)

This commit is contained in:
Andrew Poelstra 2020-10-29 17:36:56 +00:00
commit fb4ef2f8cf

View file

@ -496,7 +496,10 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose)
const uint256& hash = e.GetTx().GetHash();
UniValue info(UniValue::VOBJ);
entryToJSON(pool, info, e);
o.pushKV(hash.ToString(), info);
// Mempool has unique entries so there is no advantage in using
// UniValue::pushKV, which checks if the key already exists in O(N).
// UniValue::__pushKV is used instead which currently is O(1).
o.__pushKV(hash.ToString(), info);
}
return o;
} else {