message: Update gas price parsing
diff: @@ -496,7 +496,11 @@ UniValue createcontract(const JSONRPCRequest& request){
  }
  if (request.params.size() > 2){
  - nGasPrice = request.params[2].get_real()*COIN;
  + UniValue uGasPrice = request.params[2];
  + if(uGasPrice.get_real() < 0 || !ParseMoney(uGasPrice.getValStr(), nGasPrice))
  + {
  + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid value for gasPrice");
  + }
  CAmount maxRpcGasPrice = GetArg("-rpcmaxgasprice", MAX_RPC_GAS_PRICE);
  if (nGasPrice > (int64_t)maxRpcGasPrice)
  throw JSONRPCError(RPC_TYPE_ERROR, "Invalid value for gasPrice, Maximum allowed in RPC calls is: "+FormatMoney(maxRpcGasPrice)+" (use -rpcmaxgasprice to change it)");
  @@ -713,7 +717,11 @@ UniValue sendtocontract(const JSONRPCRequest& request){
  }
  if (request.params.size() > 4){
  - nGasPrice = request.params[4].get_real()*COIN;
  + UniValue uGasPrice = request.params[4];
  + if(uGasPrice.get_real() < 0 || !ParseMoney(uGasPrice.getValStr(), nGasPrice))
  + {
  + throw JSONRPCError(RPC_TYPE_ERROR, "Invalid value for gasPrice");
  + }
  CAmount maxRpcGasPrice = GetArg("-rpcmaxgasprice", MAX_RPC_GAS_PRICE);
  if (nGasPrice > (int64_t)maxRpcGasPrice)
  throw JSONRPCError(RPC_TYPE_ERROR, "Invalid value for gasPrice, Maximum allowed in RPC calls is: "+FormatMoney(maxRpcGasPrice)+" (use -rpcmaxgasprice to change it)");
  