Permalink
Browse files

Merge 11203 via rpc_mempoolentry_txhash

  • Loading branch information...
luke-jr committed Sep 14, 2017
2 parents 941c2f6 + cb318ff commit e731a146702cc3b4d1de6bc553479ec21305132c
Showing with 5 additions and 0 deletions.
  1. +2 −0 src/rpc/blockchain.cpp
  2. +3 −0 test/functional/segwit.py
View
@@ -343,6 +343,7 @@ std::string EntryDescriptionString()
" \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n"
" \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n"
" \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)\n"
" \"hash\" : hash, (string) hash of entire serialized transaction\n"
" \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n"
" \"transactionid\", (string) parent transaction id\n"
" ... ]\n";
@@ -363,6 +364,7 @@ void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
info.push_back(Pair("ancestorcount", e.GetCountWithAncestors()));
info.push_back(Pair("ancestorsize", e.GetSizeWithAncestors()));
info.push_back(Pair("ancestorfees", e.GetModFeesWithAncestors()));
info.push_back(Pair("hash", mempool.vTxHashes[e.vTxHashesIdx].first.ToString()));
const CTransaction& tx = e.GetTx();
std::set<std::string> setDepends;
for (const CTxIn& txin : tx.vin)
@@ -289,6 +289,9 @@ def run_test(self):
assert(txid2 in template_txids)
assert(txid3 in template_txids)
# Check that hash is properly reported in mempool entry
assert_equal(int(self.nodes[0].getmempoolentry(txid3)["hash"], 16), tx.calc_sha256(True))
# Mine a block to clear the gbt cache again.
self.nodes[0].generate(1)

0 comments on commit e731a14

Please sign in to comment.