diff --git a/joinmarket/blockchaininterface.py b/joinmarket/blockchaininterface.py index d0241c11..4d393d00 100644 --- a/joinmarket/blockchaininterface.py +++ b/joinmarket/blockchaininterface.py @@ -941,7 +941,12 @@ def add_watchonly_addresses(self, addr_list, wallet_name): log.info('importing ' + str(len(addr_list)) + ' addresses into account ' + wallet_name) for addr in addr_list: - self.rpc('importaddress', [addr, wallet_name, False]) + addr_account = self.rpc('getaccount', [addr]) + if addr_account: + log.info('Moving address ' + addr + ' into the correct wallet') + self.rpc('setaccount', [addr, wallet_name]) + else: + self.rpc('importaddress', [addr, wallet_name, False]) if jm_single().config.get("BLOCKCHAIN", "blockchain_source") != 'regtest': print('restart Bitcoin Core with -rescan if you\'re '