aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Scott <conor.r.scott.88@gmail.com>2018-02-18 10:51:17 -0500
committerConor Scott <conor.r.scott.88@gmail.com>2018-02-25 19:02:44 -0500
commitfc44cb108b8d2d701fd453657d0837b1e539bcb7 (patch)
tree83b5ea86e3b99bf1462cc951d1790b7469742004
parent4528f74fc202aa8ff152ff24f8319338fdaf3fd6 (diff)
[RPC] Add list of child transactions to verbose output of getrawmempool
-rw-r--r--src/rpc/blockchain.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index f1352a13cf..6db70890c9 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -372,6 +372,9 @@ std::string EntryDescriptionString()
" \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n"
" \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\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";
}
@@ -406,6 +409,15 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
}
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)