The synchronizer would sometimes not send 'wallet_updated' triggers
if it was fast enough to do all the work between two 0.1 sec ticks.
(is_up_to_date() would return True both before and after)
It was disabled in 680df7d6b6 due to #4421,
but that has since been fixed.
Also related is #4060; and now that that is closed, the bridge transport
is not proxied anyway.
[127.0.0.1] Exception in wrapper_func : AttributeError 'ElectrumWindow' object has no attribute 'wallet'
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/util.py", line 839, in f2
return await f(*args, **kwargs)
File "/home/user/wspace/electrum/electrum/interface.py", line 245, in wrapper_func
return await func(self, *args, **kwargs)
File "/home/user/wspace/electrum/electrum/interface.py", line 260, in run
await self.open_session(ssl_context, exit_early=False)
File "/home/user/wspace/electrum/electrum/interface.py", line 357, in open_session
await group.spawn(self.monitor_connection())
File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 241, in __aexit__
await self.join(wait=self._wait)
File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 214, in join
raise task.exception()
File "/home/user/wspace/electrum/electrum/address_synchronizer.py", line 173, in job
await group.spawn(self.synchronizer.main())
File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 241, in __aexit__
await self.join(wait=self._wait)
File "/usr/local/lib/python3.6/dist-packages/aiorpcx/curio.py", line 214, in join
raise task.exception()
File "/home/user/wspace/electrum/electrum/synchronizer.py", line 181, in main
self.wallet.network.trigger_callback('wallet_updated', self.wallet)
File "/home/user/wspace/electrum/electrum/network.py", line 267, in trigger_callback
callback(event, *args)
File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 300, in on_network
if wallet == self.wallet:
AttributeError: 'ElectrumWindow' object has no attribute 'wallet'
Not needed since aee2d8e120
And was never really working I guess (race..)
Also, during normal initial history sync, it caused the verifier to request
proofs multiple times.
this is a performance optimisation.
measurements using a large wallet with 11k txns:
syncing XPUB for the first time takes 10 seconds. leaving window open, and
syncing same XPUB again in new window takes 30 seconds. in third window,
it takes ~50 seconds. then ~70s. presumably scaling linearly.
this is due to the history_list.update_item call being CPU-heavy.
now all of them take 10 seconds.
blockchain.read_header is expensive. do cheap tests first
on a wallet with 11k txns, that is synced except for spv proofs,
finishing sync now takes 80 sec instead of 180 sec
related: 41e088693d
If our guess of a txn getting confirmed at the same height in the new chain
as it was at in the old chain is incorrect, there is a race between the
verifier and the synchronizer. If the verifier wins, the exception will cause
us to disconnect.
Comment is no longer relevant. Also, actually it was incorrect.
Each txn is only downloaded once, though 'added' multiple times to the wallet.
The triggers are only sent out by the Synchronizer, once, when downloaded.
The actual reason for the inconsistency was that get_wallet_delta can only
give complete results once the wallet is synced.
this is a bugfix: the old code always tried to connect the chunk to
network.blockchain(). the correct behaviour is to connect to the
blockchain of the interface.