electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 486ebf93e2eb3b9a1fc514696636bb31f73cb10c
parent 2fc173a76b7ba097561955aa39db5407e539e5f7
Author: ThomasV <thomasv@gitorious>
Date:   Mon, 15 Oct 2012 07:43:00 +0200

move is_up_to_date method

Diffstat:
Mlib/gui_lite.py | 2+-
Mlib/interface.py | 5++++-
Mlib/wallet.py | 9+++------
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/gui_lite.py b/lib/gui_lite.py @@ -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() diff --git a/lib/interface.py b/lib/interface.py @@ -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 diff --git a/lib/wallet.py b/lib/wallet.py @@ -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(':')