Commit Graph

6994 Commits

Author SHA1 Message Date
ThomasV 1ea49582ab fix type of forwarding_info 2023-10-17 12:36:15 +02:00
ThomasV 026a64de94 channel_announcements:
- construct_channel_announcement: return also whether
   node ids are in reverse order
 - maybe_send_channel_announcement:
   return early if signatures have not been received
2023-10-17 12:15:35 +02:00
ThomasV 0a732a0b52 trustedcoin: fix keystore name (follow-up 56e80c20d7) 2023-10-17 10:00:17 +02:00
SomberNight 30c863d32c lnaddr: don't call validate_features in parser
- 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
2023-10-16 17:10:49 +00:00
ThomasV 98a4d7b60d public channels:
- send node and channel announcements.
 - store channel_flags in constraints
 - store signatures in local and remote configs
2023-10-16 13:54:16 +02:00
ThomasV aad4fd6d48 Fix sending of 'channel_ready':
- send only once
 - in channel_reestablish, do not send it if we are not funded.
 - lnworker: do not send channel_ready before channel_reestablish
2023-10-15 10:58:37 +02:00
ThomasV 8d5f9185a4 follow-up #8646 2023-10-14 10:13:27 +02:00
ThomasV ac177577a6 lnpeer: do not set channel OPEN before channel_ready has been both sent and received.
fixes #8641
2023-10-13 16:56:25 +02:00
Sander van Grieken b20a4b9bf1 qml: increase font on seed keyboard, and height of seedkeyboard slightly 2023-10-13 13:42:16 +02:00
Sander van Grieken 8c4532c5cb qml: properly show warnings in info box in RbfBumpFeeDialog 2023-10-12 16:22:51 +02:00
Sander van Grieken 941f425ff5 qml: update invoice.canPay on channel state changes
This re-evaluates invoice.canPay when channels get connected/disconnected (enables/disables Pay button)
2023-10-12 15:53:15 +02:00
Sander van Grieken 8dbb2e0c33 qml: remove eye icon for watch-only wallets from toolbar 2023-10-12 15:17:16 +02:00
ThomasV 89023cc123 Remove trampoline hints from invoices
This has been deprecated for a long time, was kept only for
compatibility with old electrum clients.
2023-10-11 09:47:36 +02:00
SomberNight 57d2efc88d wallet: merge mktx and create_transaction 2023-10-10 17:45:26 +00:00
ThomasV f4997c3771 follow-up 7576a99a0b 2023-10-10 19:41:37 +02:00
ThomasV e882856d4f Merge pull request #8646 from accumulator/load_wallet_refactor
daemon: refactor load_wallet
2023-10-10 19:33:20 +02:00
ThomasV 7576a99a0b wallet.unlock: raise exception if password is missing (follow-up 2e52b17a43) 2023-10-10 19:23:09 +02:00
SomberNight 65394c37d5 wallet.make_unsigned_transaction: add batch_rbf/send_change params
Don't side-effect config just to modify the next call of make_unsigned_transaction >.<
Cleaner to pass parameters.
2023-10-10 17:13:18 +00:00
Sander van Grieken 7ca9b735d5 daemon: refactor load_wallet to not just return None, but raise specific exceptions.
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)
2023-10-10 17:42:07 +02:00
SomberNight bfba0dba56 storage: make partial writes pos sanity-check more robust
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)
```
2023-10-10 14:33:22 +00:00
SomberNight 63143307f1 config: follow-up rename of FEE_EST_STATIC_FEERATE
follow-up 455167136d
2023-10-10 12:11:45 +00:00
ThomasV 57c9059cab open_channel_with_peer: return funding tx
(this makes things easier the just_in_time_channels branch)
2023-10-09 17:02:19 +02:00
ThomasV 2f8325ca09 follow-up 455167136d (variable rename) 2023-10-09 12:31:23 +02:00
ThomasV f6bebec0a5 follow-up prev commit (variable rename) 2023-10-09 12:19:23 +02:00
ThomasV 455167136d CLI: new getfeerate/setfeerate API 2023-10-09 12:14:39 +02:00
ThomasV e2fb928e4f delete htlc session keys once they are no longer needed.
fixes #8630

Note: maybe we should plan a WalletDB upgrade to cleanup
existing wallets.
2023-10-08 15:52:41 +02:00
ThomasV 4e76ed6952 move INITIAL_TRAMPOLINE_FEE_LEVEL to config 2023-10-08 15:06:19 +02:00
ThomasV 3249e924d4 follow-up previous commit 2023-10-08 10:39:42 +02:00
ThomasV 2e52b17a43 CLI: replace the 'unlock' command with an option passed to load_wallet
Some use cases require the wallet to be unlocked at load time.
2023-10-08 10:21:01 +02:00
ThomasV 535f7cdcb7 follow-up previous commit 2023-10-07 17:03:13 +02:00
ThomasV 695fe004b0 setconfig: do not return 'true'
not useful (we have type checking) and sometimes confusing
(for example, when you set something to 'false')
2023-10-07 16:51:59 +02:00
ThomasV 16ef287e86 swap server: try to batch funding transactions 2023-10-07 13:26:07 +02:00
Sander van Grieken cbcafe8960 qml: remove redundant WalletDB, closes #8628 2023-10-06 12:06:00 +02:00
Sander van Grieken e4f9cfb1cc qt: clipboard might have been changed after show menu. add check. fixes #6526 2023-10-06 11:13:16 +02:00
ThomasV 40eba6f780 submarine swaps: improve labels
- claim tx was incorrectly labeled
 - if we send tx change to a swap, display both labels
2023-10-05 15:41:04 +02:00
Sander van Grieken 9ed5f7bf43 qml: don't show "select server automatically" checkbox in network setup wizard 2023-10-05 11:01:29 +02:00
ThomasV 6de40321c5 rbf batching: make sure new feerate > old feerate
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.
2023-10-04 11:57:26 +02:00
Sander van Grieken f7bf4e146d payment_identifier: move adding openalias to contacts out of _do_resolve.
This fixes "cannot pickle '_thread.RLock' object" when paying from Contacts tab
2023-10-03 11:42:12 +02:00
Sander van Grieken 67b0fa2047 qml: add extra parent_fee check. fixes #8634 2023-10-02 09:29:46 +02:00
Sander van Grieken b12c3233e5 qml: followup 5acfe418079dbc9935cf9576e50ae2c8c841e301; don't save expiry Never as default. 2023-09-30 14:45:42 +02:00
Sander van Grieken b8b5dab68a qml: properly return when current wallet is selected from wallets list 2023-09-30 14:43:11 +02:00
ThomasV 5acfe41807 qml: add never-expiring requests. fixes #8631 2023-09-30 09:46:16 +02:00
ThomasV 9ebae958dc text gui: fix WalletDB 2023-09-30 09:34:34 +02:00
Alef Farah cf4590bee3 fix recv for text gui 2023-09-29 17:35:42 -03:00
ThomasV 98cecb305e jsondb: raise an exception if a daemon thread attempts to write 2023-09-28 18:33:56 +02:00
ThomasV 71d6cc0b35 lnpeer: split 'pay' method into 'create_onion_for_route'
and 'send_htlc'

This will be useful for just_in_time channels, as we will need
to create an onion before the channel object is available.
2023-09-28 10:35:15 +02:00
ThomasV 1af6972d03 Merge pull request #8493 from spesmilo/jsonpatch_new
partial-writes using jsonpatch
2023-09-28 09:23:14 +02:00
ThomasV d79a4a0380 Merge pull request #8623 from accumulator/qml_sign_verify
qml: add message sign/verify
2023-09-28 09:20:10 +02:00
qqux 7429c29a37 Cleanup block explorers 2023-09-27 23:37:36 +00:00
Sander van Grieken e5e1e46b7b qml: add message sign/verify 2023-09-26 11:28:55 +02:00