Permalink
Browse files

[rpcwallet] Don't use floating point

Github-Pull: #8317
Rebased-From: 477777f
  • Loading branch information...
1 parent ec0afbd commit ad99a798696ac2b66be561b5a026e795d765c9fe @MarcoFalke MarcoFalke committed Jul 8, 2016
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/wallet/rpcwallet.cpp
View
@@ -595,8 +595,8 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
CScript scriptPubKey = GetScriptForDestination(address.Get());
- if (!IsMine(*pwalletMain,scriptPubKey))
- return (double)0.0;
+ if (!IsMine(*pwalletMain, scriptPubKey))
+ return ValueFromAmount(0);
// Minimum confirmations
int nMinDepth = 1;
@@ -674,7 +674,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
}
}
- return (double)nAmount / (double)COIN;
+ return ValueFromAmount(nAmount);
}

0 comments on commit ad99a79

Please sign in to comment.