Add some helpful error messages for when Diceinit fails

This commit is contained in:
Jonathan "Duke" Leto
2018-08-30 10:56:06 +02:00
parent 8200435363
commit fde85d291f
2 changed files with 13 additions and 6 deletions

View File

@@ -5303,7 +5303,10 @@ UniValue dicebet(const UniValue& params, bool fHelp)
}
if (amount > 0 && odds > 0) {
hex = DiceBet(0,name,fundingtxid,amount,odds);
if ( hex.size() > 0 )
if ( CCerror != "" )
{
ERR_RESULT(CCerror);
} else if ( hex.size() > 0 )
{
result.push_back(Pair("result", "success"));
result.push_back(Pair("hex", hex));