Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 662 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
{ | { | ||||
RPCResult{ | RPCResult{ | ||||
"for verbose = false", | "for verbose = false", | ||||
RPCResult::Type::ARR, | RPCResult::Type::ARR, | ||||
"", | "", | ||||
"", | "", | ||||
{{RPCResult::Type::STR_HEX, "", | {{RPCResult::Type::STR_HEX, "", | ||||
"The transaction id of an in-mempool ancestor transaction"}}}, | "The transaction id of an in-mempool ancestor transaction"}}}, | ||||
RPCResult{"for verbose = true", RPCResult::Type::OBJ, | RPCResult{"for verbose = true", | ||||
"transactionid", "", MempoolEntryDescription()}, | RPCResult::Type::OBJ_DYN, | ||||
"", | |||||
"", | |||||
{ | |||||
{RPCResult::Type::OBJ, "transactionid", "", | |||||
MempoolEntryDescription()}, | |||||
}}, | |||||
}, | }, | ||||
RPCExamples{HelpExampleCli("getmempoolancestors", "\"mytxid\"") + | RPCExamples{HelpExampleCli("getmempoolancestors", "\"mytxid\"") + | ||||
HelpExampleRpc("getmempoolancestors", "\"mytxid\"")}, | HelpExampleRpc("getmempoolancestors", "\"mytxid\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
bool fVerbose = false; | bool fVerbose = false; | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
Show All 17 Lines | static UniValue getmempoolancestors(const Config &config, | ||||
mempool.CalculateMemPoolAncestors(*it, setAncestors, noLimit, noLimit, | mempool.CalculateMemPoolAncestors(*it, setAncestors, noLimit, noLimit, | ||||
noLimit, noLimit, dummy, false); | noLimit, noLimit, dummy, false); | ||||
if (!fVerbose) { | if (!fVerbose) { | ||||
UniValue o(UniValue::VARR); | UniValue o(UniValue::VARR); | ||||
for (CTxMemPool::txiter ancestorIt : setAncestors) { | for (CTxMemPool::txiter ancestorIt : setAncestors) { | ||||
o.push_back(ancestorIt->GetTx().GetId().ToString()); | o.push_back(ancestorIt->GetTx().GetId().ToString()); | ||||
} | } | ||||
return o; | return o; | ||||
} else { | } else { | ||||
UniValue o(UniValue::VOBJ); | UniValue o(UniValue::VOBJ); | ||||
for (CTxMemPool::txiter ancestorIt : setAncestors) { | for (CTxMemPool::txiter ancestorIt : setAncestors) { | ||||
const CTxMemPoolEntry &e = *ancestorIt; | const CTxMemPoolEntry &e = *ancestorIt; | ||||
const TxId &_txid = e.GetTx().GetId(); | const TxId &_txid = e.GetTx().GetId(); | ||||
UniValue info(UniValue::VOBJ); | UniValue info(UniValue::VOBJ); | ||||
entryToJSON(mempool, info, e); | entryToJSON(mempool, info, e); | ||||
▲ Show 20 Lines • Show All 2,276 Lines • Show Last 20 Lines |