- construct_channel_announcement: return also whether
node ids are in reverse order
- maybe_send_channel_announcement:
return early if signatures have not been received
- see comment in lnaddr.py
- Previously we used feature bit 50/51 for trampoline.
The spec subsequently defined fbit 50/51 as option_zeroconf, which
requires fbit 46/47 (option_scid_alias) to also be set.
We moved the non-standard trampoline fbit to a different int.
However, old wallets might have old invoices saved that set fbit 50/51
for trampoline, and those would not have the dependent bit set.
Invoices are parsed at wallet-open, so if the parser ran these checks,
those wallets could not be opened.
- note: we could potentially also run lnaddr.validate_and_compare_features
when saving new invoices into the wallet but this is not done here
The following exceptions should be expected:
FileNotFoundError: given wallet path does not exist
StorageReadWriteError: given file is not readable/writable or containing folder is not writable
InvalidPassword: wallet requires a password but no password or an invalid password was given
WalletFileException: any internal wallet data issue. specific subclasses can be caught separately:
- WalletRequiresSplit: wallet needs splitting (split_data passed in Exception)
- WalletRequiresUpgrade: wallet needs upgrade, and no upgrade=True was passed to load_wallet
- WalletUnfinished: wallet file contains an action and needs additional information to finalize. (WalletDB passed in exception)
Removed qml/qewalletdb.py
This patch also fixes load_wallet calls in electrum/scripts and adds a qml workaround for dialogs opening and closing so
fast that the dialog opened==true property change is missed (which we need to manage the dialog/page stack)
The return value of f.write and f.seek cannot be compared when using open() in text mode:
```
>>> import os
>>> s = "aá"
>>>
>>> with open("a1", "w", encoding='utf-8') as f:
... a = f.write(s)
... pos = f.seek(0, os.SEEK_END)
... print(a, pos)
...
2 3
>>>
>>> with open("a2", "wb") as f:
... a = f.write(s.encode('utf-8'))
... pos = f.seek(0, os.SEEK_END)
... print(a, pos)
...
3 3
```
Was getting errors on Windows, probably due to `\r\n` vs `\n`?
```
20231010T121334.522573Z | ERROR | util.CallbackManager | cb errored. event='adb_set_up_to_date'. exc=AssertionError((2471475, 2522998))
Traceback (most recent call last):
File "...\electrum\electrum\wallet.py", line 497, in on_event_adb_set_up_to_date
self.save_db()
File "...\electrum\electrum\wallet.py", line 403, in save_db
self.db.write()
File "...\electrum\electrum\json_db.py", line 48, in wrapper
return func(self, *args, **kwargs)
File "...\electrum\electrum\json_db.py", line 389, in write
self._append_pending_changes()
File "...\electrum\electrum\json_db.py", line 48, in wrapper
return func(self, *args, **kwargs)
File "...\electrum\electrum\json_db.py", line 400, in _append_pending_changes
self.storage.append(s)
File "...\electrum\electrum\storage.py", line 110, in append
assert pos == self.pos, (self.pos, pos)
AssertionError: (2471475, 2522998)
```
Python 3.12 does not work with current aiohttp, see
https://github.com/aio-libs/aiohttp/issues/7229
It is currently possible to build a wheel using aiohttp==3.9.0b0.
However, unit tests fail in that case, because TestLNTransport::test_loop stalls.
The previous lower bound did not ensure that, sometimes
resulting in tx rejection. Note, though, that BIP125 does
not explicitly state that the new feerate must be strictly
higher than the old feerate.