Skip to content

Commit e0d02ff

Browse files
authored
Merge pull request #22 from bitpay/revert-20-0.12.1-bitcore-inputconfs
Revert "rpc: add input confirmations to getrawtransaction"
2 parents b877c39 + d28f886 commit e0d02ff

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

qa/rpc-tests/spentindex.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ def run_test(self):
103103
assert_equal(txVerbose3["vin"][0]["value"], Decimal(unspent[0]["amount"]))
104104
assert_equal(txVerbose3["vin"][0]["valueSat"], amount)
105105

106-
# Check that the input confirmations work for mempool unconfirmed transactions
107-
assert_equal(txVerbose3["vin"][0].has_key("height"), False)
108-
assert_equal(txVerbose3["vin"][0]["confirmations"], 0)
109-
110106
# Check the database index
111107
self.nodes[0].generate(1)
112108
self.sync_all()
@@ -116,10 +112,6 @@ def run_test(self):
116112
assert_equal(txVerbose4["vin"][0]["value"], Decimal(unspent[0]["amount"]))
117113
assert_equal(txVerbose4["vin"][0]["valueSat"], amount)
118114

119-
# Check that the input confirmations work
120-
assert_equal(txVerbose4["vin"][0]["height"], 107)
121-
assert_equal(txVerbose4["vin"][0]["confirmations"], 1)
122-
123115
print "Passed\n"
124116

125117

src/rpcrawtransaction.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)
8383
CSpentIndexValue spentInfo;
8484
CSpentIndexKey spentKey(txin.prevout.hash, txin.prevout.n);
8585
if (GetSpentIndex(spentKey, spentInfo)) {
86-
// Unconfirmed spentInfo have a height of -1, block 0 is unspendable
87-
if (spentInfo.blockHeight > 0) {
88-
in.push_back(Pair("height", spentInfo.blockHeight));
89-
in.push_back(Pair("confirmations", 1 + chainActive.Height() - spentInfo.blockHeight));
90-
} else {
91-
in.push_back(Pair("confirmations", 0));
92-
}
9386
in.push_back(Pair("value", ValueFromAmount(spentInfo.satoshis)));
9487
in.push_back(Pair("valueSat", spentInfo.satoshis));
9588
if (spentInfo.addressType == 1) {

0 commit comments

Comments
 (0)