[wallet] getreceivedbyaddress should return error if address is not mine

This commit is contained in:
John Newbery
2017-08-15 11:33:39 -04:00
parent ea0cd24f7d
commit 5e0ba8f8cd
2 changed files with 8 additions and 2 deletions

View File

@@ -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