mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Merge #11055: [wallet] [rpc] getreceivedbyaddress should return error if called with address not owned by the wallet
5e0ba8f8c[wallet] getreceivedbyaddress should return error if address is not mine (John Newbery)ea0cd24f7[tests] Tidy up receivedby.py (John Newbery) Pull request description: Two commits: - First commit tidies up the `receivedby.py` test (and speeds it up by factor of two) - Second commit changes getreceivedbyaddress to return error if the address is not found in wallet, and adds test to `receivedby.py` Tree-SHA512: e41342dcbd037a6b440cbe4ecd3b8ed589e18e477333f0d866f3564e948e0f5231e497d5ffb66da4e6680eb772d9f0cf839125098bb68b92d04a5ee35c6c0a81
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user