Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Lines | return " \"size\" : n, (numeric) transaction size.\n" | ||||
"ancestor transactions (including this one)\n" | "ancestor transactions (including this one)\n" | ||||
" \"ancestorsize\" : n, (numeric) virtual transaction size " | " \"ancestorsize\" : n, (numeric) virtual transaction size " | ||||
"of in-mempool ancestors (including this one)\n" | "of in-mempool ancestors (including this one)\n" | ||||
" \"ancestorfees\" : n, (numeric) modified fees (see above) " | " \"ancestorfees\" : n, (numeric) modified fees (see above) " | ||||
"of in-mempool ancestors (including this one)\n" | "of in-mempool ancestors (including this one)\n" | ||||
" \"depends\" : [ (array) unconfirmed transactions " | " \"depends\" : [ (array) unconfirmed transactions " | ||||
"used as inputs for this transaction\n" | "used as inputs for this transaction\n" | ||||
" \"transactionid\", (string) parent transaction id\n" | " \"transactionid\", (string) parent transaction id\n" | ||||
" ... ]\n" | |||||
" \"spentby\" : [ (array) unconfirmed transactions " | |||||
"spending outputs from this transaction\n" | |||||
" \"transactionid\", (string) child transaction id\n" | |||||
" ... ]\n"; | " ... ]\n"; | ||||
} | } | ||||
static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) | static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) | ||||
EXCLUSIVE_LOCKS_REQUIRED(g_mempool.cs) { | EXCLUSIVE_LOCKS_REQUIRED(g_mempool.cs) { | ||||
AssertLockHeld(g_mempool.cs); | AssertLockHeld(g_mempool.cs); | ||||
info.pushKV("size", (int)e.GetTxSize()); | info.pushKV("size", (int)e.GetTxSize()); | ||||
Show All 18 Lines | static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) | ||||
} | } | ||||
UniValue depends(UniValue::VARR); | UniValue depends(UniValue::VARR); | ||||
for (const std::string &dep : setDepends) { | for (const std::string &dep : setDepends) { | ||||
depends.push_back(dep); | depends.push_back(dep); | ||||
} | } | ||||
info.pushKV("depends", depends); | info.pushKV("depends", depends); | ||||
UniValue spent(UniValue::VARR); | |||||
const CTxMemPool::txiter &it = g_mempool.mapTx.find(tx.GetId()); | |||||
const CTxMemPool::setEntries &setChildren = | |||||
g_mempool.GetMemPoolChildren(it); | |||||
for (const CTxMemPool::txiter &childiter : setChildren) { | |||||
spent.push_back(childiter->GetTx().GetId().ToString()); | |||||
} | |||||
info.pushKV("spentby", spent); | |||||
} | } | ||||
UniValue mempoolToJSON(bool fVerbose) { | UniValue mempoolToJSON(bool fVerbose) { | ||||
if (fVerbose) { | if (fVerbose) { | ||||
LOCK(g_mempool.cs); | LOCK(g_mempool.cs); | ||||
UniValue o(UniValue::VOBJ); | UniValue o(UniValue::VOBJ); | ||||
for (const CTxMemPoolEntry &e : g_mempool.mapTx) { | for (const CTxMemPoolEntry &e : g_mempool.mapTx) { | ||||
const uint256 &txid = e.GetTx().GetId(); | const uint256 &txid = e.GetTx().GetId(); | ||||
▲ Show 20 Lines • Show All 1,472 Lines • Show Last 20 Lines |