address_sync: change up_to_date to be private; no lock needed to read
After some consideration I am fairly certain there is no need to take wallet.lock in `is_up_to_date()`. Any caller that might want some kind of guarantees re the value returned by is_up_to_date() would need to enforce them itself by e.g. taking wallet.lock around its critical code block. That is, even if is_up_to_date() itself takes the lock, between the call returning and the caller reading the value there could still have been a race. Also, the GUI was directly accessing the field already.
This commit is contained in:
@@ -118,7 +118,7 @@ class ElectrumGui(BaseElectrumGui):
|
||||
|
||||
def get_balance(self):
|
||||
if self.wallet.network.is_connected():
|
||||
if not self.wallet.up_to_date:
|
||||
if not self.wallet.is_up_to_date():
|
||||
msg = _("Synchronizing...")
|
||||
else:
|
||||
c, u, x = self.wallet.get_balance()
|
||||
|
||||
Reference in New Issue
Block a user