1
0
Commit Graph

16566 Commits

Author SHA1 Message Date
Sander van Grieken
0428fc7c0a qml: add explanatory infomessage when sending capacity is significantly less than local balance.
Show message when attempting unfreeze of gossip channel in trampoline mode
2023-07-13 19:17:16 +02:00
Sander van Grieken
45944d280d qml: update channelbar when conditions change 2023-07-13 19:17:16 +02:00
Sander van Grieken
2cf4cc1978 qml: render reserved channel capacity in a darker tone, take frozen into account 2023-07-13 19:17:16 +02:00
Sander van Grieken
4900d01344 allow more time to detect tor 2023-07-13 18:51:48 +02:00
Sander van Grieken
0d7ff92c43 send_tab: remove payment_identifier comments in send_tab 2023-07-11 19:54:07 +02:00
Sander van Grieken
40f15b158c payment_identifier: reconstruct PI for bip70 invoice in pay_onchain_dialog instead of taking the send_tab PI 2023-07-11 17:16:27 +02:00
SomberNight
5b9b616146 simple_config: allow deepcopy-ing ConfigVars
Was getting error:
```
>>> import copy
>>> from electrum.simple_config import SimpleConfig
>>> copy.deepcopy(SimpleConfig.EXPERIMENTAL_LN_FORWARD_PAYMENTS)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\Python\Python310\lib\copy.py", line 161, in deepcopy
    rv = reductor(4)
TypeError: cannot pickle 'ConfigVar' object
```

This is useful in tests/test_lnpeer.py, to deepcopy the GRAPH_DEFINITIONS dict.
2023-07-11 14:50:09 +00:00
Sander van Grieken
b1b2190f0a payment_identifier: add payment_identifier_from_invoice function to reconstruct a PI from bip70 invoice 2023-07-11 16:43:49 +02:00
Sander van Grieken
ad4b431738 payment_identifier: fix setting self.bolt11 to invoice in bip21 LN alt case 2023-07-11 15:24:03 +02:00
Sander van Grieken
33acfd3d1c followup d15050a2bf 2023-07-11 14:24:43 +02:00
Sander van Grieken
78a741e4a3 actually remove the FIXME 2023-07-11 14:19:54 +02:00
SomberNight
d695dd51cd build: include AppStream metainfo.xml in tarballs
closes https://github.com/spesmilo/electrum/issues/8501
related https://github.com/spesmilo/electrum/pull/8149
2023-07-11 12:17:40 +00:00
Sander van Grieken
d15050a2bf payment_identifier: fix _on_finalize params, fix lnurlp send comment instead of description,
refactor payment_identifier.get_invoice to standalone invoice_from_payment_identifier
2023-07-11 14:15:17 +02:00
Sander van Grieken
b6863b4854 qml: add LabelSync toggle 2023-07-11 12:51:37 +02:00
SomberNight
bb8c73cabd qt: kind of fix bip70 notify_merchant logic by passing around PI
```
229.18 | E | gui.qt.main_window.[test_segwit_2] | on_error
Traceback (most recent call last):
  File "...\electrum\gui\qt\util.py", line 917, in run
    result = task.task()
  File "...\electrum\gui\qt\send_tab.py", line 681, in broadcast_thread
    if self.payto_e.payment_identifier.has_expired():
AttributeError: 'NoneType' object has no attribute 'has_expired'
```

In SendTab.broadcast_transaction.broadcast_thread, self.payto_e.payment_identifier was referenced -
but do_clear() has already cleared it by then.
E.g. consider SendTab.pay_onchain_dialog: it calls save_pending_invoice(), which calls do_clear(),
and later (in sign_done), it calls window.broadcast_or_show, which will call SendTab.broadcast_transaction().

As there might be multiple independent transaction dialogs open simultaneously, the single shared state
send_tab.payto_e.payment_identifier approach was problematic -- I think it is conceptually nicer to
pass around the payment_identifiers as needed, as done with this change.

However, this change is not a full proper fix, as it still somewhat relies on
send_tab.payto_e.payment_identifier (e.g. in pay_onchain_dialog). Hence, e.g. when using
the invoice_list context menu "Pay..." item, as payto_e.payment_identifier is not set,
payment_identifier will be None in broadcast_transaction.

but at least we handle PI being None gracefully -- before this change, broadcast_transaction
expected PI to be set, and it was never set to the correct thing (as do_clear() already ran by then):
depending on timing it was either None or a new empty PI. In the former case, producing the above
traceback and hard failing (not only for bip70 stuff!), and in the latter, silently ignoring the logic bug.
2023-07-10 18:16:56 +00:00
SomberNight
f2dbf47413 payment_identifier.py: add some type hints, trivial clean-up 2023-07-10 17:59:56 +00:00
SomberNight
612a8e6424 qt: fix: bip70 pay reqs need x509 verification
regression from https://github.com/spesmilo/electrum/pull/8462

- pr.verify() was called in qml, but not in qt gui
- we now call pr.verify() in get_payment_request(), to make the API less error-prone
- it is now ok to call pr.verify() multiple times, the result is cached
2023-07-10 17:50:53 +00:00
Sander van Grieken
023e8ff0eb qml: remember invoice/qr type on ReceiveDialog 2023-07-10 18:10:15 +02:00
Sander van Grieken
86d79f3ec9 qml: show backup type, as in qt 2023-07-10 14:45:36 +02:00
Sander van Grieken
a572b9bf87 lnchannel: add noop get_local_scid_alias for ChannelBackup 2023-07-10 14:22:38 +02:00
SomberNight
0b0d58b289 qml: fix "copy" and "share" buttons for channel backup dialogs
The QR code was shown but the copy/share buttons did not do anything.
2023-07-10 11:23:31 +00:00
Sander van Grieken
6dd630cf3b followup f5a8cc7076 2023-07-10 11:39:16 +02:00
ThomasV
63a5ca4f93 Merge pull request #8529 from Toporin/patch_parse_URI
Patch error caused by the method "parse_URI()" being moved to bip21.py and renamed "parse_bip21_URI"
2023-07-10 10:58:23 +02:00
Toporin
f5a8cc7076 Patch error caused by the method "parse_URI()" being moved and renamed:
Aucun périphérique matériel détecté.
Pour déclencher un nouveau scan, pressez 'Suivant'.

Sur Linux, vous pouvez avoir à ajouter une nouvelle permission à vos règles udev.


Message de débogage
  bitbox02: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading bitbox02 plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  coldcard: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading coldcard plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  digitalbitbox: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading digitalbitbox plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  jade: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading jade plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  keepkey: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading keepkey plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  ledger: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading ledger plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  safe_t: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading safe_t plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  satochip: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading satochip plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
  trezor: (error during plugin init)
    Vous avez peut-être une bibliothèque incompatible.
    Error loading trezor plugin: ImportError("cannot import name 'parse_URI' from 'electrum.util' (/Users/satochip/Documents/github/electrum-satochip/dist/Electrum.app/Contents/MacOS/electrum/util.pyc)")
2023-07-10 09:50:35 +01:00
Sander van Grieken
2d95c457dd qml: addressdetails item order, add technical properties header 2023-07-09 13:43:39 +02:00
Sander van Grieken
016b5eb743 qml: show private key in address details 2023-07-09 13:43:39 +02:00
Sander van Grieken
5f2fee5184 qml: strip whitespace of data pasted/scanned before processing 2023-07-09 11:56:21 +02:00
ThomasV
4b29a46890 lnpeer: fix logging of 'will fullfill htlc' 2023-07-09 10:06:46 +02:00
ThomasV
6bacd65a80 payment_identifter: add FIXME 2023-07-09 10:05:31 +02:00
ThomasV
5cf320b2c7 Merge pull request #8462 from spesmilo/payment_identifiers2
Payment identifiers
2023-07-09 10:02:14 +02:00
Sander van Grieken
ae8c4f1281 payment_identifier: check if payment identifier is usable and enable/disable Send/Pay buttons 2023-07-08 12:19:37 +02:00
Sander van Grieken
f980bd97b5 payment_identifier: factor out bip21 functions to bip21.py to break cyclic dependencies,
parse bolt11 only once, store invoice internally instead of bolt11 string
add is_onchain method to indicate if payment identifier can be paid onchain
2023-07-08 12:18:37 +02:00
Sander van Grieken
7f766f6dfb payment_identifiers: also match local contacts 2023-07-07 22:54:46 +02:00
Sander van Grieken
db6779bf04 qt: show send tab if payment identifier is passed on the cmdline 2023-07-07 20:49:45 +02:00
ThomasV
9b41bcf992 setFrozen: use light blue, black text is difficult to read on a blue background 2023-07-07 17:05:08 +02:00
Sander van Grieken
44f83b78e2 trezor: model T is 'T', not '2' 2023-07-07 14:00:27 +02:00
Sander van Grieken
be0ef5f961 trezor: allow PIN of length 50 for T1 firmware >=1.10.0 and TT firmware >=2.4.0 (closes #8526) 2023-07-07 12:33:55 +02:00
Sander van Grieken
c4e8869c1a qml: add PIN auth to close channel operation. 2023-07-04 14:05:10 +02:00
Sander van Grieken
5f8b8ce97e qml: show channel backup and explanatory message before local force close, and let user confirm before doing the close operation
also show message dialog after close succeeded instead of just closing the channel close dialog
2023-07-04 12:51:26 +02:00
Sander van Grieken
b6010aad0f paytoedit: promote to QWidget and encapsulate QLineEdit vs QTextEdit juggling 2023-07-03 16:33:07 +02:00
SomberNight
d65aa3369f daemon: split standardize_path from daemon._wallets keying
- standardize_path is made more lenient: it no longer calls os.path.realpath,
  as that was causing issues on Windows with some mounted drives
- daemon._wallets is still keyed on the old strict standardize_path, but
  filesystem operations in WalletStorage use the new lenient standardize_path.
  - daemon._wallets is strict to forbid opening the same logical file twice concurrently
  - fs operations however work better on the non-resolved paths, so they use those

closes https://github.com/spesmilo/electrum/issues/8495
2023-06-30 11:15:16 +00:00
SomberNight
0d29733419 qml/qedaemon.py: don't use daemon._wallets field directly
it's more robust to use the public methods
2023-06-30 10:11:16 +00:00
Sander van Grieken
eeda06e751 payment_identifier: fix error path for bip70 2023-06-30 11:44:13 +02:00
SomberNight
6b43eac6fd lnonion: rm support for legacy (pre-TLV) onions
see https://github.com/lightning/bolts/pull/962
2023-06-29 14:34:06 +00:00
SomberNight
fc6486ecdb lnaddr: make payment_secret field mandatory, in both directions
we now require payment_secret both for sending and for receiving
(previously was optional for both)

see
https://github.com/lightning/bolts/pull/898
https://github.com/ACINQ/eclair/pull/1810
https://github.com/ElementsProject/lightning/pull/4646

note: payment_secret depends on var_onion_optin, so that becomes mandatory as well,
however this commit does not yet remove the ability of creating legacy onions
2023-06-29 14:34:02 +00:00
SomberNight
a66b0c6a12 lnaddr: rm some tests where feature bits do not make sense
Not all feature flags are supposed to go into the invoice.
2023-06-29 13:55:15 +00:00
SomberNight
8ef2495096 lnworker: use NamedTuple for received_mpp_htlcs. add/fix type hints
try to avoid long plain tuples
2023-06-29 13:48:02 +00:00
Sander van Grieken
81544fdaed send_tab: simplify lock_recipient check 2023-06-28 16:49:28 +02:00
Sander van Grieken
30abcad999 payment_identifier: move amount_range into payment_identifier 2023-06-28 16:49:28 +02:00
Sander van Grieken
49dab82efa send_tab: add spinner for network lookup indication 2023-06-28 16:49:28 +02:00