From 6dbd6a9af126833e1b9b9fcdf2b7d4a486fd2897 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 26 Dec 2021 12:34:59 +0300 Subject: [PATCH] Fix amount checking --- src/bitcoinrpc.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 445f68c..06263b0 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -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)) -- 1.7.1