mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
rpc: Speedup getrawmempool when verbose=true
Co-Authored-By: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
parent
efed9809b4
commit
2d5cf4c41d
1 changed files with 4 additions and 1 deletions
|
@ -474,7 +474,10 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose)
|
||||||
const uint256& hash = e.GetTx().GetHash();
|
const uint256& hash = e.GetTx().GetHash();
|
||||||
UniValue info(UniValue::VOBJ);
|
UniValue info(UniValue::VOBJ);
|
||||||
entryToJSON(pool, info, e);
|
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;
|
return o;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue