From 5e0ba8f8cd55a5c2cea4e4e2343d7dcd52aa8fad Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 15 Aug 2017 11:33:39 -0400 Subject: [wallet] getreceivedbyaddress should return error if address is not mine --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wallet/rpcwallet.cpp') diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index d4015f6c8..8abb4c9a2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -654,7 +654,7 @@ UniValue getreceivedbyaddress(const JSONRPCRequest& request) } CScript scriptPubKey = GetScriptForDestination(dest); if (!IsMine(*pwallet, scriptPubKey)) { - return ValueFromAmount(0); + throw JSONRPCError(RPC_WALLET_ERROR, "Address not found in wallet"); } // Minimum confirmations -- cgit v1.2.3