From ac3a0123b72b3550de50138718ee6f23e84a7f17 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sat, 26 Sep 2015 10:55:46 -0700 Subject: [PATCH] Fixed IX confirmation bug for gettransaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IX confirmations now show up correctly via the RPC interface immediately after IX confirms they are double-spend proof: gettransaction 64c04e06ac058e572cefb5d98728dba21401cb8826f9688cbaf4270adfc6afb2  { "amount" : 0.00000000, "fee" : -0.01000000, "confirmations" : 5, "bcconfirmations" : 0, "txid" : "64c04e06ac058e572cefb5d98728dba21401cb8826f9688cbaf4270adfc6afb2", "walletconflicts" : [ } ... a moment later ...  gettransaction 64c04e06ac058e572cefb5d98728dba21401cb8826f9688cbaf4270adfc6afb2  { "amount" : 0.00000000, "fee" : -0.01000000, "confirmations" : 6, "bcconfirmations" : 1, "blockhash" : "00000000000f850e60431a5a88fba1cd8d3868477056f65493664e2d39c1837c", "blockindex" : 2, "blocktime" : 1443290068, "txid" : "64c04e06ac058e572cefb5d98728dba21401cb8826f9688cbaf4270adfc6afb2", "walletconflicts" : [ ], } --- src/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f660860fc6..c60c819a35 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -48,7 +48,7 @@ void EnsureWalletIsUnlocked() void WalletTxToJSON(const CWalletTx& wtx, Object& entry) { int confirms = wtx.GetDepthInMainChain(false); - int confirmsTotal = wtx.GetDepthInMainChain(); + int confirmsTotal = GetIXConfirmations(wtx.GetHash()) + confirms; entry.push_back(Pair("confirmations", confirmsTotal)); entry.push_back(Pair("bcconfirmations", confirms)); if (wtx.IsCoinBase())