added proc of incorrect tokenid to tokenorders

This commit is contained in:
dimxy
2019-01-17 20:41:18 +05:00
parent 4b71e62557
commit 80a1ef04f2

View File

@@ -6974,9 +6974,13 @@ UniValue tokenorders(const UniValue& params, bool fHelp)
throw runtime_error("tokenorders [tokenid]\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");
if ( params.size() == 1 )
tokenid = Parseuint256((char *)params[0].get_str().c_str());
else memset(&tokenid,0,sizeof(tokenid));
if (params.size() == 1) {
tokenid = Parseuint256((char *)params[0].get_str().c_str());
if (tokenid == zeroid)
throw runtime_error("incorrect tokenid\n");
}
else
memset(&tokenid,0,sizeof(tokenid));
return(AssetOrders(tokenid));
}