mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
[rpcwallet] Don't use floating point
This commit is contained in:
parent
ff46dd4a34
commit
477777f250
1 changed files with 3 additions and 3 deletions
|
@ -564,8 +564,8 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp)
|
||||||
if (!address.IsValid())
|
if (!address.IsValid())
|
||||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
|
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin 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;
|
||||||
|
@ -643,7 +643,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (double)nAmount / (double)COIN;
|
return ValueFromAmount(nAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue