Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to use empty imported addresses as change #7330

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion electrum/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,8 @@ class Imported_Wallet(Simple_Wallet):

def __init__(self, db, storage, *, config):
Abstract_Wallet.__init__(self, db, storage, config=config)
#Keep the old default behaviour of not using change address in imported wallets
self.use_change = db.get('use_change', False)

def is_watching_only(self):
return self.keystore is None
Expand Down Expand Up @@ -2681,7 +2683,7 @@ def get_receiving_addresses(self, **kwargs):
return self.get_addresses()

def get_change_addresses(self, **kwargs):
return []
return [addr for addr in self.get_addresses() if len(self.db.get_addr_history(addr)) == 0]

def import_addresses(self, addresses: List[str], *,
write_to_disk=True) -> Tuple[List[str], List[Tuple[str, str]]]:
Expand Down