Browse Source

Do not round input amounts; allow RPC full precision.

miguelfreitas
Gavin Andresen 14 years ago
parent
commit
789259d2e7
  1. 2
      rpc.cpp

2
rpc.cpp

@ -65,7 +65,7 @@ int64 AmountFromValue(const Value& value)
double dAmount = value.get_real(); double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 21000000.0) if (dAmount <= 0.0 || dAmount > 21000000.0)
throw JSONRPCError(-3, "Invalid amount"); throw JSONRPCError(-3, "Invalid amount");
int64 nAmount = roundint64(dAmount * 100.00) * CENT; int64 nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount)) if (!MoneyRange(nAmount))
throw JSONRPCError(-3, "Invalid amount"); throw JSONRPCError(-3, "Invalid amount");
return nAmount; return nAmount;

Loading…
Cancel
Save