1
0

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:
SomberNight
2022-04-08 20:33:13 +02:00
parent 6c05de6fb9
commit 837fc1606c
5 changed files with 13 additions and 13 deletions

View File

@@ -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()