MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / getrawmempool

Function getrawmempool

src/rpc/mempool.cpp:668–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected