The wallet needs its own up_to_date logic:
- the adb being up_to_date means all its addresses are synced
- but an HD wallet might decide to roll the gap limit and generate new addresses
- the adb does not know about this...
- the wallet should be considered *not* up_to_date
- relatedly, it is now the wallet that decides to reset the network request counters
- note that wallet.main() was never cleaned up previously.
- now wallet gets its own taskgroup, which is cleaned up in wallet.stop.
Follow-up to adb refactor: 121d8732f1
The `WE_ARE_TOXIC` state is added as a sanity check to ensure that if
the remote has proven that we have lost state we do not accidentally
do a local force-close. E.g. if we receive an "error" message for the
channel, we might normally do an automatic force-close. Manually
force-closing in such a state is not offered anymore by the GUI.
The `REQUESTED_FCLOSE` state is added as it is quite likely that
we receive an error message from the remote after requesting a fclose,
e.g. during a later chan-reestablish. In such a scenario, we should
not do an auto-local-fclose, however the manual option of a local-fclose
should still be offered.
- separate AddressSynchronizer from Wallet and LNWatcher
- the AddressSynchronizer class is referred to as 'adb' (address database)
- Use callbacks to replace overloaded methods
note: unclear where to put these files... `contrib/build-wine/` and `contrib/osx/`
contain binary-building-related files. maybe we could have a `doc/` folder
if the need for more similar files arise.
atm there are these two, plus maybe `contrib/docker_notes.md`.
One usecase is perhaps to save space if using trampoline anyway...
more importantly, if using gossip, LNGossip is heavily filtering what messages we request and get,
and e.g. can missing new NodeAnnouncements, etc,
and this is a quick-and-dirty workaround to force a fresh start.
this ports https://github.com/Electron-Cash/Electron-Cash/pull/1371
including commits:
---
bab816e2c3
Buttons Editor: Make background non-transparent and change to push button
There were some issues with transparent backgrounds with QToolButton on
Linux and as there is no real reason for them to be transparent we just
make them opaque.
---
2cb698affc
Pay to editor: Fix size computations to use the proper values
Previously this did not take into account the spacing between lines nor
the margins of the control and the document. There is also a sensible
minimum height of one line now and it expands to up to 10 lines before
we show the scroll bar. When the scroll bar is active, we move the buttons
so they do not obscure the scroll bar.
---
1b7a70f4f5
Pay to editor: Increase height by one if cursor is under buttons
---
abd42d9f66
Buttons Editor: Always center if the document is just one line high
---
33bd0b82e0
Pay to editor: Make button movement on scrollbar change reliable
---
94f8476c2e
Pay to editor: Use document lineCount instead of height
---
5bedfce392
Buttons Editor: Improve vertical centering of the buttons, needs to take into account the frame width
---
0cd0b490c4
Buttons Editor: Add transparent border which is somehow needed for correct macOS layout
kivy 2.1 seemingly became more sensitive to threading issues.
This used to work on kivy 2.0 and older, but 2.1 is complaining.
```
I | paymentrequest | Error while contacting payment URL: https://bitpay.com/i/... -- error type: <class 'aiohttp.client_exceptions.ClientResponseError'> -- Got HTTP status code 404.
E | util | Exception in get_payment_request: TypeError('Cannot create graphics instruction outside the main Kivy thread')
Traceback (most recent call last):
File "/home/user/wspace/electrum/electrum/util.py", line 1175, in wrapper
return await func(*args, **kwargs)
File "/home/user/wspace/electrum/electrum/util.py", line 1033, in get_payment_request
on_pr(request)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 460, in on_pr
self.show_error("invoice error:" + pr.error)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1066, in show_error
self.show_info_bubble(text=error, icon=icon, width=width,
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1092, in show_info_bubble
info_bubble = self.info_bubble = Factory.InfoBubble()
File "/usr/local/lib/python3.8/dist-packages/kivy/uix/bubble.py", line 199, in __init__
self._arrow_layout = BoxLayout()
File "/usr/local/lib/python3.8/dist-packages/kivy/uix/boxlayout.py", line 145, in __init__
super(BoxLayout, self).__init__(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/kivy/uix/layout.py", line 76, in __init__
super(Layout, self).__init__(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/kivy/uix/widget.py", line 361, in __init__
self.canvas = Canvas(opacity=self.opacity)
File "kivy/graphics/instructions.pyx", line 608, in kivy.graphics.instructions.Canvas.__init__
File "kivy/graphics/instructions.pyx", line 154, in kivy.graphics.instructions.InstructionGroup.__init__
File "kivy/graphics/instructions.pyx", line 60, in kivy.graphics.instructions.Instruction.__init__
TypeError: Cannot create graphics instruction outside the main Kivy thread
```
- Do not send ping if messages have been received recently.
- Do not send more than one ping.
- Await pong before sending commitment_signed (per BOLT-2)
- Lower ping time to 30s
closes https://github.com/spesmilo/electrum/issues/4072
(this fix AFAICT only works on Windows, and #4072 contains some macOS reports as well,
however all recent reports are for Windows and overall most reports are for Windows,
so let's close it optimistically for now)
protobuf 4.x introduced breaking changes compared to 3.20.
To adapt, we would have to regenerate paymentrequest_pb2.py, using protoc>=3.19.0, however ubuntu does not have new enough protoc.
Also, unsure if newly generated paymentrequest_pb2.py would be supported by older versions of protobuf.
Best to just wait for things to settle.
```
electrum/__init__.py:20: in <module>
from .wallet import Wallet
electrum/wallet.py:70: in <module>
from . import transaction, bitcoin, coinchooser, paymentrequest, ecc, bip32
electrum/paymentrequest.py:37: in <module>
from . import paymentrequest_pb2 as pb2
electrum/paymentrequest_pb2.py:36: in <module>
_descriptor.FieldDescriptor(
.tox/py3/lib/python3.9/site-packages/google/protobuf/descriptor.py:560: in __new__
_message.Message._CheckCalledFromGeneratedFile()
E TypeError: Descriptors cannot not be created directly.
E If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
E If you cannot immediately regenerate your protos, some other possible workarounds are:
E 1. Downgrade the protobuf package to 3.20.x or lower.
E 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E
E More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```
ceaae1b6a3/CHANGES.txt (L47)