fix get transactions crash
This commit is contained in:
@@ -91,16 +91,17 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
|
|||||||
//int32_t i,n,txheight; uint32_t locktime; uint64_t interest = 0;
|
//int32_t i,n,txheight; uint32_t locktime; uint64_t interest = 0;
|
||||||
int confirms = wtx.GetDepthInMainChain();
|
int confirms = wtx.GetDepthInMainChain();
|
||||||
entry.push_back(Pair("rawconfirmations", confirms));
|
entry.push_back(Pair("rawconfirmations", confirms));
|
||||||
entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)mapBlockIndex[wtx.hashBlock]->nHeight,confirms)));
|
|
||||||
if (wtx.IsCoinBase())
|
if (wtx.IsCoinBase())
|
||||||
entry.push_back(Pair("generated", true));
|
entry.push_back(Pair("generated", true));
|
||||||
if (confirms > 0)
|
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("blockhash", wtx.hashBlock.GetHex()));
|
||||||
entry.push_back(Pair("blockindex", wtx.nIndex));
|
entry.push_back(Pair("blockindex", wtx.nIndex));
|
||||||
entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));
|
entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));
|
||||||
entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight));
|
entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight));
|
||||||
}
|
} else entry.push_back(Pair("confirmations", confirms));
|
||||||
|
|
||||||
uint256 hash = wtx.GetHash();
|
uint256 hash = wtx.GetHash();
|
||||||
entry.push_back(Pair("txid", hash.GetHex()));
|
entry.push_back(Pair("txid", hash.GetHex()));
|
||||||
UniValue conflicts(UniValue::VARR);
|
UniValue conflicts(UniValue::VARR);
|
||||||
|
|||||||
Reference in New Issue
Block a user