1
0
Commit Graph

21 Commits

Author SHA1 Message Date
SomberNight
1c20a29a22 Revert "wallet.is_up_to_date: fix flickering during sync due to race"
This reverts commit dc6c481406 as it introduced its own issue:
while add_address was running on one thread, synchronizer._reset could be running on another,
and by the time the "enqueue" coro would run, it would use a new add_queue and
addr would not be in requested_addrs anymore...

```
I/w | wallet.Standard_Wallet.[test_segwit_2] | starting taskgroup.
I | lnworker.LNWallet.[test_segwit_2] | starting taskgroup.
E/i | interface.[testnet.qtornado.com:51002] | Exception in run: KeyError('tb1q3wmgf8n5eettnj50pzgnfrrpdpjmwn37x7nzsc5780kk4je9v4hspym8mu')
Traceback (most recent call last):
  File ".../electrum/electrum/util.py", line 1243, in wrapper
    return await func(*args, **kwargs)
  File ".../electrum/electrum/interface.py", line 506, in wrapper_func
    return await func(self, *args, **kwargs)
  File ".../electrum/electrum/interface.py", line 529, in run
    await self.open_session(ssl_context)
  File ".../electrum/electrum/interface.py", line 679, in open_session
    async with self.taskgroup as group:
  File ".../aiorpcX/aiorpcx/curio.py", line 304, in __aexit__
    await self.join()
  File ".../electrum/electrum/util.py", line 1339, in join
    task.result()
  File ".../electrum/electrum/synchronizer.py", line 80, in _run_tasks
    async with taskgroup as group:
  File ".../aiorpcX/aiorpcx/curio.py", line 304, in __aexit__
    await self.join()
  File ".../electrum/electrum/util.py", line 1339, in join
    task.result()
  File ".../electrum/electrum/synchronizer.py", line 127, in subscribe_to_address
    self.requested_addrs.remove(addr)
KeyError: 'tb1q3wmgf8n5eettnj50pzgnfrrpdpjmwn37x7nzsc5780kk4je9v4hspym8mu'
```
2022-12-20 16:15:24 +00:00
SomberNight
dc6c481406 wallet.is_up_to_date: fix flickering during sync due to race
AddressSynchronizer.add_address called synchronizer.add, which would only
schedule adding the addr to the Synchronizer in the next event loop iter.
If during that time, the synchronizer called adb.set_up_to_date(True),
the wallet would falsely believe and advertise itself as up_to_date
(as the wallet would see wallet.synchronize not creating new addresses,
and adb (via synchronizer) telling it is up_to_date).
Moments later, the synchronizer._add_address is finally executed and
up_to_date=False propagates out synchronizer->adb->wallet.
2022-12-20 13:58:02 +00:00
SomberNight
01b5e3f8e0 flake8: enable more mandatory tests 2022-10-31 16:13:22 +00:00
SomberNight
46dc675b1f scripts: fix py3.6 compat in update_default_servers.py
Note: this was causing a weird flake8 error on CI. Presumably due to CI running flake8 via py3.7.

```
flake8 . --count --select=$ELECTRUM_LINTERS --show-source --statistics
./electrum/scripts/update_default_servers.py:1:26: E999 SyntaxError: invalid syntax
#!/usr/bin/env python3

^
1     E999 SyntaxError: invalid syntax
1
```
2022-01-20 16:59:10 +01:00
SomberNight
3851ce5dd1 scripts: add "update_default_servers.py" 2022-01-18 19:50:46 +01:00
SomberNight
4937fd2788 scripts: add script that broadcasts tx to lots of servers
useful when trying to RBF a tx that did not opt-in to RBF
2021-02-23 04:19:47 +01:00
bitromortac
673f89f0d2 scripts: add Lightning feature analysis script 2021-01-11 11:37:14 +01:00
SomberNight
c9bf1d4c80 scripts: add script to showcase bruteforcing wallet file password 2020-09-01 18:15:37 +02:00
SomberNight
42da407ee1 scripts: update quick_start.py to work with 4.0.x internals
fixes #6453
2020-08-25 16:22:59 +02:00
Luke Childs
7b122d2679 Automated BIP39 Recovery, squashed 2020-08-20 17:50:39 +02:00
SomberNight
adc3784bc2 network: allow mixed protocols among interfaces
Previously all the interfaces used either "t" or "s".
Now the network only tries to use "s" for all interfaces, except for
the main interface, which the user can manually specify to use "t".
(so e.g. if you run with "--server localhost:50002:t", the main server will use "t",
but all the rest will use "s")
2020-04-16 21:19:42 +02:00
SomberNight
bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
04edad9984 config: no longer singleton. it is passed to Wallet.__init__
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
2019-09-22 20:46:01 +02:00
SomberNight
d1026b5afe follow-up: SimpleConfig is supposed to be singleton
see cefa4762ba
and #5629
2019-09-10 16:38:10 +02:00
SomberNight
7b9047d8d6 scripts: simplify quick_start 2019-02-28 20:26:30 +01:00
SomberNight
92bf409bf0 scripts: add "quick_start" to showcase some basic functionality 2019-02-15 21:14:08 +01:00
ThomasV
4ed8787433 remove 'util.py' from scripts 2019-02-05 20:33:50 +01:00
SomberNight
1a5c77aa82 follow-up prev 2018-11-02 20:37:37 +01:00
SomberNight
e37da62a1c fix most "scripts"
related: #4754
2018-11-02 20:14:59 +01:00
SomberNight
e5e3ac0364 fix #4720 2018-09-17 14:44:01 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00