aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-10-01 11:28:51 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-10-01 11:28:55 +0200
commit3fd192f8b4d6db386354dfe635a8a6a105b55de8 (patch)
tree39f8a9caf006a6fe38d89b98a57fb94c56f3cd28 /src/rpcserver.cpp
parentb25551101c7ceff8af862131c30c08527ff60160 (diff)
parentc122f5528c882efc8aebe31fd4d84612175f66aa (diff)
Merge pull request #4234
c122f55 qt: Register CAmount metatype (Wladimir J. van der Laan) a372168 Use a typedef for monetary values (Mark Friedenbach)
Diffstat (limited to 'src/rpcserver.cpp')
-rw-r--r--src/rpcserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index 190de62282..1a41344da5 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -88,18 +88,18 @@ static inline int64_t roundint64(double d)
return (int64_t)(d > 0 ? d + 0.5 : d - 0.5);
}
-int64_t AmountFromValue(const Value& value)
+CAmount AmountFromValue(const Value& value)
{
double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 21000000.0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
- int64_t nAmount = roundint64(dAmount * COIN);
+ CAmount nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount))
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
return nAmount;
}
-Value ValueFromAmount(int64_t amount)
+Value ValueFromAmount(const CAmount& amount)
{
return (double)amount / (double)COIN;
}