Fix gettransaction crash with dpowconfs

This commit is contained in:
jl777
2018-10-24 04:54:29 -11:00
parent b4e1a4f87b
commit f776d51149
2 changed files with 3 additions and 3 deletions

View File

@@ -279,7 +279,7 @@ uint64_t DiceCalc(int64_t bet,int64_t odds,int64_t minbet,int64_t maxbet,int64_t
break;
}
}
fprintf(stderr,"modval %d vs %d\n",modval,(int32_t)(10000/(odds+1)));
//fprintf(stderr,"modval %d vs %d\n",modval,(int32_t)(10000/(odds+1)));
if ( modval < 10000/(odds+1) )
winnings = bet * (odds+1);
}

View File

@@ -91,16 +91,16 @@ 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);