MCPcopy Create free account
hub / github.com/ElementsProject/elements / getrawmempool

Function getrawmempool

src/rpc/blockchain.cpp:663–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663static RPCHelpMan getrawmempool()
664{
665 return RPCHelpMan{"getrawmempool",
666 "\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
667 "\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n",
668 {
669 {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
670 {"mempool_sequence", RPCArg::Type::BOOL, RPCArg::Default{false}, "If verbose=false, returns a json object with transaction list and mempool sequence number attached."},
671 },
672 {
673 RPCResult{"for verbose = false",
674 RPCResult::Type::ARR, "", "",
675 {
676 {RPCResult::Type::STR_HEX, "", "The transaction id"},
677 }},
678 RPCResult{"for verbose = true",
679 RPCResult::Type::OBJ_DYN, "", "",
680 {
681 {RPCResult::Type::OBJ, "transactionid", "", MempoolEntryDescription()},
682 }},
683 RPCResult{"for verbose = false and mempool_sequence = true",
684 RPCResult::Type::OBJ, "", "",
685 {
686 {RPCResult::Type::ARR, "txids", "",
687 {
688 {RPCResult::Type::STR_HEX, "", "The transaction id"},
689 }},
690 {RPCResult::Type::NUM, "mempool_sequence", "The mempool sequence value."},
691 }},
692 },
693 RPCExamples{
694 HelpExampleCli("getrawmempool", "true")
695 + HelpExampleRpc("getrawmempool", "true")
696 },
697 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
698{
699 bool fVerbose = false;
700 if (!request.params[0].isNull())
701 fVerbose = request.params[0].get_bool();
702
703 bool include_mempool_sequence = false;
704 if (!request.params[1].isNull()) {
705 include_mempool_sequence = request.params[1].get_bool();
706 }
707
708 return MempoolToJSON(EnsureAnyMemPool(request.context), fVerbose, include_mempool_sequence);
709},
710 };
711}
712
713static RPCHelpMan getmempoolancestors()
714{

Callers

nothing calls this directly

Calls 6

MempoolEntryDescriptionFunction · 0.85
HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
MempoolToJSONFunction · 0.85
get_boolMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected