From 80a1ef04f2a2ffcddaa2712bedc49dd5c486894e Mon Sep 17 00:00:00 2001 From: dimxy Date: Thu, 17 Jan 2019 20:41:18 +0500 Subject: [PATCH] added proc of incorrect tokenid to tokenorders --- src/wallet/rpcwallet.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 6928f4361..0710bc698 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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)); }