1
0
Commit Graph

14811 Commits

Author SHA1 Message Date
SomberNight
9b48a97f65 lnutil.LnFeatures.get_names: don't return Nones for unknown features
follow-up 85d354bf24

`'\n'.join(lnaddr.get_features().get_names())` would raise otherwise
2022-07-21 17:06:20 +02:00
Sander van Grieken
c0dc1a9eaa qml: separate proxy and server controls from wizardcontainer, so we can reuse them in
network settings later
2022-07-21 16:03:14 +02:00
Sander van Grieken
ccd182ec18 qml: qenetwork events don't need to be handled in qt thread
don't retrieve fee histogram from backend as it's passed in the event
2022-07-21 14:15:06 +02:00
ThomasV
e7554ba225 Merge pull request #7898 from gruve-p/patch-3
appimage: Bump git
2022-07-21 13:49:45 +02:00
Sander van Grieken
a970c0f78a qml: add initial bolt-11/bip-21 chooser in requestdialog
implement proper placement of icon over qr code
fix urlencoding in qr imageprovider
2022-07-21 12:56:55 +02:00
ThomasV
f5b1f7d2d9 Generalize ChannelDetailsDialog to channel backups.
Access funding_tx and closing_tx from the dialog,
instead of from the channels_list context menu.
2022-07-21 11:41:49 +02:00
ThomasV
3afee67ea3 kivy GUI: show better error message if we cannot channel backup import because lightning is disabled or unavailable. fixes #7899 2022-07-21 09:11:55 +02:00
ThomasV
b5617ec0fd lnworker: get_channel_objects method to be used by GUI 2022-07-20 21:07:13 +02:00
ThomasV
4a27e4e51a fix #7895: rename parameter 2022-07-20 20:31:26 +02:00
ThomasV
af1fb1ae9f remove_channel_backup: a channel backup might be in both lists 2022-07-20 17:00:57 +02:00
ThomasV
90610de58e auto-remove redeemed channel backups
This restores commit 02e4569086.
That commit was reverted because I wrongly assumed that it
would break lnworker.has_conflicting_backup_with.
2022-07-20 16:50:57 +02:00
gruve-p
bc5b5eb0b1 appimage: Bump git
https://launchpad.net/ubuntu/+source/git/1:2.17.1-1ubuntu0.12
2022-07-20 15:45:01 +02:00
Sander van Grieken
9147e84010 qml: finally! 2022-07-20 11:08:59 +02:00
Sander van Grieken
fd7bd64ce8 qml: delete WizardComponents, move into NewWalletWizard 2022-07-20 11:08:55 +02:00
Sander van Grieken
802246251f qml: visually dim channels in CLOSED and REDEEMED states, apply simple sort on channel state
to put channels in closed/redeemed state at bottom of list
2022-07-20 11:08:50 +02:00
Sander van Grieken
0cc22931d8 qml: don't expose WalletListModel as a declarative type 2022-07-20 11:08:46 +02:00
Sander van Grieken
8523fc134f qml: slip39 disabled for now 2022-07-20 11:08:40 +02:00
Sander van Grieken
6aded403b8 qml: pin lock after inactivity 2022-07-20 11:08:31 +02:00
ThomasV
5faef83874 rm dead code 2022-07-20 09:56:53 +02:00
ThomasV
30609cdc63 Qt: simplify lightning_tx_dialog using ShowQRLineEdit 2022-07-20 09:51:26 +02:00
Sander van Grieken
bbbb19eee4 qml: dedupe swap auth handling, fix fee values when no tx 2022-07-20 07:53:41 +02:00
Sander van Grieken
2ea1d88567 qml: use closebutton icon for label edit cancel
UI PIN entry dialog
2022-07-20 07:53:25 +02:00
ThomasV
6a74ffe80e Qt: improve channel details dialog. Add util.ShowQRLineEdit class. 2022-07-19 14:57:33 +02:00
ThomasV
4ff1ed5de5 show_lightning_invoice: minor improvements 2022-07-19 10:32:22 +02:00
ThomasV
85d354bf24 Qt show_lightning_invoice: show features 2022-07-19 10:15:55 +02:00
ThomasV
1568c10ca0 fix 'view log' menu (follow-up 2d68350900) 2022-07-18 14:09:50 +02:00
SomberNight
ed65f335bd wallet_db upgrade: fix possible corruption of invoice amounts
see https://github.com/spesmilo/electrum/pull/7774
2022-07-15 18:26:13 +02:00
SomberNight
d5b5f82b01 LN invoice: better handle unknown required featured bits in bolt11 invs
A user provided an invoice that requires feature bit 30. (That bit is not in the spec)
To test:
```
lnbc1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnsdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkucqzpgxq9z0rgqsp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmq9q8pqqqssq4gacn859tpzz99hkusnh7m93d5ncpx3t4zns8ynca7akmljpl5vh504qjz7dqwewqjh4md7xagaz5wg85knvxywrhp0sp2t09yta7lcq3qs6fy

lntb1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnssp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmqdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkuxq9z0rgq9q8pqqqssqdte0z9dy7ur7fagsk7r3mtfj6upq88xfylhufys87zqpamklcfgn2f3xeq3nlhvn3qy9tdgg42vq9eq99qz6rz6tzqezfhzuv6zsr5qp7cgel4
```
2022-07-15 18:00:33 +02:00
ThomasV
f5abd4f1d1 add command line for rebalancing channels 2022-07-13 10:14:34 +02:00
SomberNight
1e97491124 qt QRDialog: make dialog usefully resizeable
In commit 9bba65199e,
the QRCodeWidget was put inside a BoxLayout as a workaround to avoid the "copy to clipboard" and
"save as file" functionality grabbing extra whitespace/stretch/padding and putting it into the
exported image.

However, in turn that commit introduced a bug, where making the dialog larger does not make the
QRCodeWidget larger (which worked prior).

This commit tries to fix the regression and also the original bug.
2022-07-12 19:26:01 +02:00
Sander van Grieken
894495aa92 qml: clean up 2022-07-12 19:07:19 +02:00
Sander van Grieken
63fed38305 qml: skip wallet password entry when single_password and password is known 2022-07-12 17:34:52 +02:00
Sander van Grieken
70cf44ccec qml: wip single password 2022-07-12 16:55:11 +02:00
SomberNight
430a61eb42 qt QRDialog: try to fix layout-sizing issues
related https://github.com/spesmilo/electrum/pull/7218
closes https://github.com/spesmilo/electrum/pull/7223
2022-07-12 16:50:49 +02:00
SomberNight
28fe345b0b keystore.check_password: raise better exc if called on pwless ks
If keystore.check_password is called with some pw on a keystore that does not have a password set,
it now raises better exceptions: it should now always raise InvalidPassword, and with a nicer msg.
Previously the exc type would depend on the ks type.

Examples before change:

```
>>> wallet.keystore.check_password("asd")
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/keystore.py", line 580, in check_password
    xprv = pw_decode(self.xprv, password, version=self.pw_hash_version)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 311, in pw_decode
    plaintext_bytes = pw_decode_bytes(data, password, version=version)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 270, in pw_decode_bytes
    data_bytes = bytes(base64.b64decode(data))
  File "/usr/lib/python3.10/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
```

```
>>> wallet.keystore.check_password("asd")
Traceback (most recent call last):
    s = aes_decrypt_with_iv(secret, iv, e)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 157, in aes_decrypt_with_iv
    data = decryptor.update(data) + decryptor.finalize()
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/base.py", line 148, in finalize
    data = self._ctx.finalize()
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 193, in finalize
    raise ValueError(
ValueError: The length of the provided data is not a multiple of the block length.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/console.py", line 254, in exec_command
    result = eval(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
  File "/home/user/wspace/electrum/electrum/keystore.py", line 248, in check_password
    self.get_private_key(pubkey, password)
  File "/home/user/wspace/electrum/electrum/keystore.py", line 267, in get_private_key
    sec = pw_decode(self.keypairs[pubkey], password, version=self.pw_hash_version)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 311, in pw_decode
    plaintext_bytes = pw_decode_bytes(data, password, version=version)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 271, in pw_decode_bytes
    return _pw_decode_raw(data_bytes, password, version=version)
  File "/home/user/wspace/electrum/electrum/crypto.py", line 255, in _pw_decode_raw
    raise InvalidPassword() from e
electrum.util.InvalidPassword: Incorrect password
```

-----

Examples after change:
```
>>> wallet.keystore.check_password("asd")
Traceback (most recent call last):
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\keystore.py", line 68, in wrapper
    return check_password_fn(self, password)
  File "...\electrum\keystore.py", line 605, in check_password
    xprv = pw_decode(self.xprv, password, version=self.pw_hash_version)
  File "...\electrum\crypto.py", line 311, in pw_decode
    plaintext_bytes = pw_decode_bytes(data, password, version=version)
  File "...\electrum\crypto.py", line 267, in pw_decode_bytes
    raise CiphertextFormatError("ciphertext not valid base64") from e
electrum.crypto.CiphertextFormatError: ciphertext not valid base64

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\gui\qt\console.py", line 254, in exec_command
    result = eval(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
  File "...\electrum\keystore.py", line 76, in wrapper
    raise InvalidPassword("password given but keystore has no password") from e
electrum.util.InvalidPassword: password given but keystore has no password
```

```
>>> wallet.keystore.check_password("asd")
Traceback (most recent call last):
    s = aes_decrypt_with_iv(secret, iv, e)
  File "...\electrum\crypto.py", line 158, in aes_decrypt_with_iv
    data = cipher.decrypt(data)
  File "...\Python310\site-packages\Cryptodome\Cipher\_mode_cbc.py", line 246, in decrypt
    raise ValueError("Data must be padded to %d byte boundary in CBC mode" % self.block_size)
ValueError: Data must be padded to 16 byte boundary in CBC mode

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\keystore.py", line 68, in wrapper
    return check_password_fn(self, password)
  File "...\electrum\keystore.py", line 272, in check_password
    self.get_private_key(pubkey, password)
  File "...\electrum\keystore.py", line 291, in get_private_key
    sec = pw_decode(self.keypairs[pubkey], password, version=self.pw_hash_version)
  File "...\electrum\crypto.py", line 311, in pw_decode
    plaintext_bytes = pw_decode_bytes(data, password, version=version)
  File "...\electrum\crypto.py", line 268, in pw_decode_bytes
    return _pw_decode_raw(data_bytes, password, version=version)
  File "...\electrum\crypto.py", line 249, in _pw_decode_raw
    raise InvalidPassword() from e
electrum.util.InvalidPassword: Incorrect password

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "...\electrum\gui\qt\console.py", line 254, in exec_command
    result = eval(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
  File "...\electrum\keystore.py", line 76, in wrapper
    raise InvalidPassword("password given but keystore has no password") from e
electrum.util.InvalidPassword: password given but keystore has no password
```
2022-07-12 15:50:45 +02:00
SomberNight
79fec3417a crypto.py: rm {En,De}codeAES_base64. instead use {En,De}codeAES_bytes 2022-07-12 15:50:42 +02:00
SomberNight
d067e0e314 wallet: make "invoices" and "receive_requests" private
Other modules should use getters such as "get_request(key)" or "get_unpaid_requests()",
direct access is error-prone.
2022-07-12 15:46:47 +02:00
SomberNight
056de017f0 wallet: use get_request(addr) instead of receive_requests[addr]
since "invoice unification", requests are often keyed by rhash
2022-07-12 15:38:54 +02:00
SomberNight
44655bcca2 qt qrtextedit: also show icon in ShowQRTextEdit.contextMenu
follow-up 955986d024
2022-07-12 15:33:28 +02:00
ThomasV
436360db10 revert 02e4569086 2022-07-12 14:17:22 +02:00
ThomasV
46cfe781e3 initial release notes for 4.3 2022-07-12 14:16:49 +02:00
Sander van Grieken
d0a9420c87 qml: fix initial focus wallet name in new wallet wizard 2022-07-12 14:01:04 +02:00
Sander van Grieken
f83c944f0e qml: properly set keystore password when creating new wallet 2022-07-12 14:00:53 +02:00
ThomasV
02e4569086 auto-remove redeemed channel backups. fix indentation. 2022-07-12 10:13:19 +02:00
SomberNight
955986d024 qt: PayToEdit and OverlayControlMixin: move around input buttons 2022-07-11 19:08:53 +02:00
SomberNight
2c73e7f854 wallet: (regression) fix get_spendable_coins when "domain" arg is given
`get_spendable_coins` was ignoring the "domain" param, and returning utxos for the whole wallet
2022-07-11 16:18:38 +02:00
ThomasV
9ae0e5bffc remove lightning parameter from wallet.create_request 2022-07-11 13:52:13 +02:00
ThomasV
957174a039 all GUIs: show local and remote force-close options in a homogeneous way 2022-07-11 13:08:04 +02:00
ThomasV
8c991ef656 channels_list: refactor menu. Add request_force_close option for channels too, guard it with a confirmation dialog. 2022-07-11 12:16:17 +02:00
ThomasV
88b2dc3589 show onchain address of request in CLI. Fixes #7886 2022-07-11 11:35:21 +02:00