From 4d47fcb9371c24507109c4427f870dcc3653db91 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 16 Aug 2018 01:07:44 -1100 Subject: [PATCH] Create nonzero tokens --- src/wallet/rpcwallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 977aee98d..1597051f2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5411,6 +5411,11 @@ UniValue tokencreate(const UniValue& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); name = params[0].get_str(); supply = atof(params[1].get_str().c_str()) * COIN; + if ( name.size() == 0 || supply <= 0 ) + { + result.push_back(Pair("error", "invalid parameter")); + return(result); + } if ( params.size() == 3 ) { description = params[2].get_str();