MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / mempoolToJSON

Function mempoolToJSON

src/rpc/blockchain.cpp:455–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455UniValue mempoolToJSON(bool fVerbose)
456{
457 if (fVerbose)
458 {
459 LOCK(mempool.cs);
460 UniValue o(UniValue::VOBJ);
461 for (const CTxMemPoolEntry& e : mempool.mapTx)
462 {
463 const uint256& hash = e.GetTx().GetHash();
464 UniValue info(UniValue::VOBJ);
465 entryToJSON(info, e);
466 o.pushKV(hash.ToString(), info);
467 }
468 return o;
469 }
470 else
471 {
472 std::vector<uint256> vtxid;
473 mempool.queryHashes(vtxid);
474
475 UniValue a(UniValue::VARR);
476 for (const uint256& hash : vtxid)
477 a.push_back(hash.ToString());
478
479 return a;
480 }
481}
482
483static UniValue getrawmempool(const JSONRPCRequest& request)
484{

Callers 2

rest_mempool_contentsFunction · 0.85
getrawmempoolFunction · 0.85

Calls 5

queryHashesMethod · 0.80
GetHashMethod · 0.45
pushKVMethod · 0.45
ToStringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected