From 789259d2e72f28330dbe70e8acfdf752bd950b76 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Wed, 23 Feb 2011 14:41:19 -0500 Subject: [PATCH] Do not round input amounts; allow RPC full precision. --- rpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc.cpp b/rpc.cpp index ae1968d48..1c6f228e5 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -65,7 +65,7 @@ int64 AmountFromValue(const Value& value) double dAmount = value.get_real(); if (dAmount <= 0.0 || dAmount > 21000000.0) throw JSONRPCError(-3, "Invalid amount"); - int64 nAmount = roundint64(dAmount * 100.00) * CENT; + int64 nAmount = roundint64(dAmount * COIN); if (!MoneyRange(nAmount)) throw JSONRPCError(-3, "Invalid amount"); return nAmount;