changeset 29684:efabd6cee156

Revert "rpc: add input confirmations to getrawtransaction"
author Braydon Fuller <courier@braydon.com>
date Wed, 15 Jun 2016 20:22:35 -0400
parents 3709b8538925
children c778c74e4adb
files qa/rpc-tests/spentindex.py src/rpcrawtransaction.cpp
diffstat 2 files changed, 0 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/qa/rpc-tests/spentindex.py	Wed Jun 15 13:37:04 2016 -0400
+++ b/qa/rpc-tests/spentindex.py	Wed Jun 15 20:22:35 2016 -0400
@@ -103,10 +103,6 @@
         assert_equal(txVerbose3["vin"][0]["value"], Decimal(unspent[0]["amount"]))
         assert_equal(txVerbose3["vin"][0]["valueSat"], amount)
 
-        # Check that the input confirmations work for mempool unconfirmed transactions
-        assert_equal(txVerbose3["vin"][0].has_key("height"), False)
-        assert_equal(txVerbose3["vin"][0]["confirmations"], 0)
-
         # Check the database index
         self.nodes[0].generate(1)
         self.sync_all()
@@ -116,10 +112,6 @@
         assert_equal(txVerbose4["vin"][0]["value"], Decimal(unspent[0]["amount"]))
         assert_equal(txVerbose4["vin"][0]["valueSat"], amount)
 
-        # Check that the input confirmations work
-        assert_equal(txVerbose4["vin"][0]["height"], 107)
-        assert_equal(txVerbose4["vin"][0]["confirmations"], 1)
-
         print "Passed\n"
 
 
--- a/src/rpcrawtransaction.cpp	Wed Jun 15 13:37:04 2016 -0400
+++ b/src/rpcrawtransaction.cpp	Wed Jun 15 20:22:35 2016 -0400
@@ -83,13 +83,6 @@
             CSpentIndexValue spentInfo;
             CSpentIndexKey spentKey(txin.prevout.hash, txin.prevout.n);
             if (GetSpentIndex(spentKey, spentInfo)) {
-                // Unconfirmed spentInfo have a height of -1, block 0 is unspendable
-                if (spentInfo.blockHeight > 0) {
-                    in.push_back(Pair("height", spentInfo.blockHeight));
-                    in.push_back(Pair("confirmations", 1 + chainActive.Height() - spentInfo.blockHeight));
-                } else {
-                    in.push_back(Pair("confirmations", 0));
-                }
                 in.push_back(Pair("value", ValueFromAmount(spentInfo.satoshis)));
                 in.push_back(Pair("valueSat", spentInfo.satoshis));
                 if (spentInfo.addressType == 1) {