The current master has the feature to add watch-only addresses (RPC importaddress). There is no way to remove watch-only addresses (looks like the unwritten law to not remove/erase anything from the wallet ;-). This PR adds it. The RPC call is named removeaddress. It has only one argument, the address/script to be removed.
You can't remove the address you don't watch in the wallet, you can't remove the address with a privkey.
Problems/questions:
- After the call, your walletdb contains transactions added by previous (optional) rescan of the call
importaddress. I do not touch them, because you can always runbitcoind -zapwallettxes=1to get rid of them. - Qt GUI needs a small fix in
TransactionFilterProxy::filterAcceptsRow():
if(address.isEmpty())
return false;
(or similar...) to not display these transactions after watch-only addresses are removed.
3. Qt GUI needs to auto-refresh the list of Recent transactions (the right tab on the main screen) because after removeaddress the list is not updated (watch-only transactions are still shown). Or you can restart GUI...
4. I do not remove the address from addressbook, because it could have been added even before adding it in importaddress.