mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 11:40:42 +02:00
[RPC] Add list of child transactions to verbose output of getrawmempool
This commit is contained in:
parent
4528f74fc2
commit
fc44cb108b
@ -372,6 +372,9 @@ std::string EntryDescriptionString()
|
|||||||
" \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n"
|
" \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n"
|
||||||
" \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n"
|
" \"depends\" : [ (array) unconfirmed transactions 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";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,6 +409,15 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
info.pushKV("depends", depends);
|
info.pushKV("depends", depends);
|
||||||
|
|
||||||
|
UniValue spent(UniValue::VARR);
|
||||||
|
const CTxMemPool::txiter &it = mempool.mapTx.find(tx.GetHash());
|
||||||
|
const CTxMemPool::setEntries &setChildren = mempool.GetMemPoolChildren(it);
|
||||||
|
for (const CTxMemPool::txiter &childiter : setChildren) {
|
||||||
|
spent.push_back(childiter->GetTx().GetHash().ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
info.pushKV("spentby", spent);
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue mempoolToJSON(bool fVerbose)
|
UniValue mempoolToJSON(bool fVerbose)
|
||||||
|
Loading…
Reference in New Issue
Block a user