From 0779df5d5116bdc9e494cf680e30716e27fc2057 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 24 Oct 2018 04:53:37 -1100 Subject: [PATCH] fix get transactions crash --- src/wallet/rpcwallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c6ea4c8b3..480f73e6f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -91,16 +91,17 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry) //int32_t i,n,txheight; uint32_t locktime; uint64_t interest = 0; int confirms = wtx.GetDepthInMainChain(); entry.push_back(Pair("rawconfirmations", confirms)); - entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)mapBlockIndex[wtx.hashBlock]->nHeight,confirms))); if (wtx.IsCoinBase()) entry.push_back(Pair("generated", true)); if (confirms > 0) { + entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)mapBlockIndex[wtx.hashBlock]->nHeight,confirms))); entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex())); entry.push_back(Pair("blockindex", wtx.nIndex)); entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime())); entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight)); - } + } else entry.push_back(Pair("confirmations", confirms)); + uint256 hash = wtx.GetHash(); entry.push_back(Pair("txid", hash.GetHex())); UniValue conflicts(UniValue::VARR);