Skip to content

Commit

Permalink
[rpcwallet] Don't use floating point
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Jul 8, 2016
1 parent ff46dd4 commit 477777f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet/rpcwallet.cpp
Expand Up @@ -564,8 +564,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;
Expand Down Expand Up @@ -643,7 +643,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
}
}

return (double)nAmount / (double)COIN;
return ValueFromAmount(nAmount);
}


Expand Down

0 comments on commit 477777f

Please sign in to comment.