mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
wallet.is_mine: use inheritance for more readable code
This commit is contained in:
parent
d1e2ca4bc5
commit
d92a6d46eb
1 changed files with 6 additions and 4 deletions
|
@ -332,10 +332,6 @@ class Abstract_Wallet(PrintError):
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
def is_mine(self, address):
|
def is_mine(self, address):
|
||||||
if hasattr(self, '_addr_to_addr_index'): # Deterministic_Wallet
|
|
||||||
return address in self._addr_to_addr_index
|
|
||||||
if hasattr(self, 'addresses'): # Imported_Wallet
|
|
||||||
return address in self.addresses
|
|
||||||
return address in self.get_addresses()
|
return address in self.get_addresses()
|
||||||
|
|
||||||
def is_change(self, address):
|
def is_change(self, address):
|
||||||
|
@ -1466,6 +1462,9 @@ class Imported_Wallet(Simple_Wallet):
|
||||||
def is_beyond_limit(self, address, is_change):
|
def is_beyond_limit(self, address, is_change):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def is_mine(self, address):
|
||||||
|
return address in self.addresses
|
||||||
|
|
||||||
def get_fingerprint(self):
|
def get_fingerprint(self):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -1712,6 +1711,9 @@ class Deterministic_Wallet(Abstract_Wallet):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def is_mine(self, address):
|
||||||
|
return address in self._addr_to_addr_index
|
||||||
|
|
||||||
def get_master_public_keys(self):
|
def get_master_public_keys(self):
|
||||||
return [self.get_master_public_key()]
|
return [self.get_master_public_key()]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue