[rpcwallet] Don't use floating point

This commit is contained in:
MarcoFalke
2016-07-08 12:01:39 +02:00
committed by Jack Grigg
parent 181c511cd0
commit b37b4b2fa3

View File

@@ -597,8 +597,8 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
if (!address.IsValid()) if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zcash address"); throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Zcash address");
CScript scriptPubKey = GetScriptForDestination(address.Get()); CScript scriptPubKey = GetScriptForDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey)) if (!IsMine(*pwalletMain, scriptPubKey))
return (double)0.0; return ValueFromAmount(0);
// Minimum confirmations // Minimum confirmations
int nMinDepth = 1; int nMinDepth = 1;
@@ -676,7 +676,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
} }
} }
return (double)nAmount / (double)COIN; return ValueFromAmount(nAmount);
} }