diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -7,3 +7,5 @@ enabled, `prune_height`, `automatic_pruning`, and `prune_target_size`. - The help message also reflects this. - Code standard updated to c++14. + - Remove `depends` from transaction objects provided by `getblocktemplate`. + \ No newline at end of file diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -615,32 +615,19 @@ aCaps.push_back("proposal"); UniValue transactions(UniValue::VARR); - std::map setTxIndex; - int i = 0; + int index_in_template = 0; for (const auto &it : pblock->vtx) { const CTransaction &tx = *it; uint256 txId = tx.GetId(); - setTxIndex[txId] = i++; if (tx.IsCoinBase()) { continue; } UniValue entry(UniValue::VOBJ); - entry.pushKV("data", EncodeHexTx(tx)); entry.pushKV("txid", txId.GetHex()); entry.pushKV("hash", tx.GetHash().GetHex()); - - UniValue deps(UniValue::VARR); - for (const CTxIn &in : tx.vin) { - if (setTxIndex.count(in.prevout.GetTxId())) { - deps.push_back(setTxIndex[in.prevout.GetTxId()]); - } - } - entry.pushKV("depends", deps); - - int index_in_template = i - 1; entry.pushKV("fee", pblocktemplate->entries[index_in_template].fees / SATOSHI); int64_t nTxSigOps = @@ -648,6 +635,7 @@ entry.pushKV("sigops", nTxSigOps); transactions.push_back(entry); + index_in_template++; } UniValue aux(UniValue::VOBJ);