Skip to content

Commit 477777f

Browse files
author
MarcoFalke
committed
[rpcwallet] Don't use floating point
1 parent ff46dd4 commit 477777f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,8 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
564564
if (!address.IsValid())
565565
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
566566
CScript scriptPubKey = GetScriptForDestination(address.Get());
567-
if (!IsMine(*pwalletMain,scriptPubKey))
568-
return (double)0.0;
567+
if (!IsMine(*pwalletMain, scriptPubKey))
568+
return ValueFromAmount(0);
569569

570570
// Minimum confirmations
571571
int nMinDepth = 1;
@@ -643,7 +643,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
643643
}
644644
}
645645

646-
return (double)nAmount / (double)COIN;
646+
return ValueFromAmount(nAmount);
647647
}
648648

649649

0 commit comments

Comments
 (0)