From 75dbd478191ef550743337c659ffa7b3fcbb4473 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Aug 2018 04:26:06 -1100 Subject: [PATCH] Status zero --- src/wallet/rpcwallet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index b12c335a7..2fe16d504 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5262,7 +5262,7 @@ UniValue dicefinish(const UniValue& params, bool fHelp) UniValue dicestatus(const UniValue& params, bool fHelp) { UniValue result(UniValue::VOBJ); char *name; uint256 fundingtxid,bettxid; uint64_t amount; std::string status; double winnings; - if ( fHelp || params.size() != 3 ) + if ( fHelp || params.size() == 2 || params.size() == 3 ) throw runtime_error("dicestatus name fundingtxid bettxid\n"); if ( ensure_CCrequirements() < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); @@ -5270,7 +5270,9 @@ UniValue dicestatus(const UniValue& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); name = (char *)params[0].get_str().c_str(); fundingtxid = Parseuint256((char *)params[1].get_str().c_str()); - bettxid = Parseuint256((char *)params[2].get_str().c_str()); + memset(&bettxid,0,sizeof(bettxid)); + if ( params.size() == 3 ) + bettxid = Parseuint256((char *)params[2].get_str().c_str()); winnings = DiceStatus(0,name,fundingtxid,bettxid); result.push_back(Pair("result", "success")); if ( winnings >= 0. )