mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
move is_up_to_date method
This commit is contained in:
parent
2fc173a76b
commit
486ebf93e2
3 changed files with 8 additions and 8 deletions
|
@ -790,7 +790,7 @@ class MiniDriver(QObject):
|
|||
self.connecting()
|
||||
elif not self.wallet.blocks == -1:
|
||||
self.connecting()
|
||||
elif not self.wallet.is_up_to_date:
|
||||
elif not self.wallet.up_to_date:
|
||||
self.synchronizing()
|
||||
else:
|
||||
self.ready()
|
||||
|
|
|
@ -367,6 +367,9 @@ class Interface(TcpStratumInterface, HttpStratumInterface):
|
|||
self.is_connected = False # this exits the polling loop
|
||||
self.poke()
|
||||
|
||||
def is_up_to_date(self):
|
||||
return self.responses.empty() and not self.unanswered_requests
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -470,7 +473,7 @@ class WalletSynchronizer(threading.Thread):
|
|||
if new_addresses:
|
||||
self.interface.subscribe(new_addresses)
|
||||
|
||||
if self.wallet.is_up_to_date():
|
||||
if self.interface.is_up_to_date():
|
||||
if not self.wallet.up_to_date:
|
||||
self.wallet.up_to_date = True
|
||||
self.wallet.was_updated = True
|
||||
|
|
|
@ -293,9 +293,9 @@ class Wallet:
|
|||
self.blocks = -1
|
||||
self.banner = ''
|
||||
|
||||
# there is a difference between self.up_to_date and self.is_up_to_date()
|
||||
# self.is_up_to_date() returns true when all requests have been answered and processed
|
||||
# self.up_to_date is true when the wallet is synchronized (stronger requirement)
|
||||
# there is a difference between wallet.up_to_date and interface.is_up_to_date()
|
||||
# interface.is_up_to_date() returns true when all requests have been answered and processed
|
||||
# wallet.up_to_date is true when the wallet is synchronized (stronger requirement)
|
||||
self.up_to_date_event = threading.Event()
|
||||
self.up_to_date_event.clear()
|
||||
self.up_to_date = False
|
||||
|
@ -316,9 +316,6 @@ class Wallet:
|
|||
callbacks = self.update_callbacks[:]
|
||||
[update() for update in callbacks]
|
||||
|
||||
def is_up_to_date(self):
|
||||
return self.interface.responses.empty() and not self.interface.unanswered_requests
|
||||
|
||||
|
||||
def import_key(self, keypair, password):
|
||||
address, key = keypair.split(':')
|
||||
|
|
Loading…
Add table
Reference in a new issue