| 453 | } |
| 454 | |
| 455 | UniValue 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 | |
| 483 | static UniValue getrawmempool(const JSONRPCRequest& request) |
| 484 | { |
no test coverage detected