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

Function getmempoolentry

src/rpc/blockchain.cpp:643–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643static UniValue getmempoolentry(const JSONRPCRequest& request)
644{
645 if (request.fHelp || request.params.size() != 1) {
646 throw std::runtime_error(
647 "getmempoolentry txid\n"
648 "\nReturns mempool data for given transaction\n"
649 "\nArguments:\n"
650 "1. \"txid\" (string, required) The transaction id (must be in mempool)\n"
651 "\nResult:\n"
652 "{ (json object)\n"
653 + EntryDescriptionString()
654 + "}\n"
655 "\nExamples:\n"
656 + HelpExampleCli("getmempoolentry", "\"mytxid\"")
657 + HelpExampleRpc("getmempoolentry", "\"mytxid\"")
658 );
659 }
660
661 uint256 hash = ParseHashV(request.params[0], "parameter 1");
662
663 LOCK(mempool.cs);
664
665 CTxMemPool::txiter it = mempool.mapTx.find(hash);
666 if (it == mempool.mapTx.end()) {
667 throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not in mempool");
668 }
669
670 const CTxMemPoolEntry &e = *it;
671 UniValue info(UniValue::VOBJ);
672 entryToJSON(info, e);
673 return info;
674}
675
676static UniValue getblockhash(const JSONRPCRequest& request)
677{

Callers

nothing calls this directly

Calls 8

EntryDescriptionStringFunction · 0.85
HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
ParseHashVFunction · 0.85
JSONRPCErrorFunction · 0.85
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected