Fix amount checking
authoruser <balthazar@yandex.ru>
Sun, 26 Dec 2021 09:34:59 +0000 (12:34 +0300)
committeruser <balthazar@yandex.ru>
Sun, 26 Dec 2021 09:34:59 +0000 (12:34 +0300)
src/bitcoinrpc.cpp

index 445f68c..06263b0 100644 (file)
@@ -85,7 +85,7 @@ void RPCTypeCheck(const Object& o,
 int64_t AmountFromValue(const Value& value)
 {
     double dAmount = value.get_real();
-    if (dAmount <= 0.0 || dAmount > MAX_MONEY)
+    if (dAmount <= 0.0 || dAmount > (double) (MAX_MONEY / 100000000))
         throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
     int64_t nAmount = roundint64(dAmount * COIN);
     if (!MoneyRange(nAmount))