1
0
Commit Graph

17631 Commits

Author SHA1 Message Date
SomberNight
0d0aa0f04a build: appimage: dl xcb-util as debian src pkg instead of upstream git
The upstream git repo has been unreachable for at least days.
2024-09-10 15:45:07 +00:00
SomberNight
2ebf8fd9ef qt gui: use QGuiApplication.setApplicationName
I noticed that when running from source on macOS, the OS menubar has an "About Python" menu item,
instead of an "About Electrum" menu item. I tried to fix that by this, but actually it is not working :P

Nevertheless, this looks useful at least on Linux and Windows. E.g. when instantiating a new dialog
without an explicit title, the qt application name is used as default.

The application name, without this change AFAICS was already "Electrum" when running any of the binaries.
However when running from source, it was in some cases "python" or "run_electrum" or even "electrum-4"
(depending on OS and how the main script is started).
Now it is consistent -- except on macOS it still is not, as there it really wants to look for a .plist...
2024-09-09 16:34:43 +00:00
ghost43
2f9ce3ff8c Merge pull request #9183 from JamieDriver/jade_native_psbt
Jade native psbt
2024-09-09 14:41:47 +00:00
SomberNight
f091f23776 follow-up moving some funcs from ecc.py to bitcoin.py (no. 2)
follow-up 2f3d89f415
2024-09-06 17:05:23 +00:00
Jamie C. Driver
2cba0708d5 jade: use Jade's native PSBT signing and remove massaging into legacy format 2024-09-05 08:40:45 +01:00
Jamie C. Driver
11f5ba31ce jade: update Jade api to 1.0.31
This extends the serial api to recognise recently supported hardware.
2024-09-05 08:40:45 +01:00
SomberNight
a674a22155 follow-up moving some funcs from ecc.py to bitcoin.py
follow-up 2f3d89f415
2024-09-03 16:58:41 +00:00
ghost43
fcb4d06421 Merge pull request #9170 from SomberNight/202408_android_qr_set_max_brightness
qml/android: set max screen brightness when displaying QR codes
2024-09-02 15:45:11 +00:00
SomberNight
a54751ee4f gui: qt: tx dialog: add option to copy scriptpubkey of output
if there is no corresponding address
(otherwise due to "..." elision, the full spk would be inaccessible)
2024-09-02 14:54:15 +00:00
SomberNight
5ad8c97c1d hww: ledger: update udev rules and model ids
see https://github.com/bitcoin-core/HWI/pull/746

maybe closes https://github.com/spesmilo/electrum/issues/9179
2024-09-02 13:50:35 +00:00
SomberNight
7a7b43c0a8 qml/android: set max screen brightness when displaying QR codes
In some cases this makes it much easier to successfully scan a QR code.
I was trying to scan a PSBT using a laptop camera from my phone screen for 2 minutes, until I realised the screen brightness was the issue.  o.O
2024-08-21 23:37:36 +00:00
SomberNight
bd845080b8 build: update pinned trezorlib (partial rerun freeze_packages)
related https://github.com/spesmilo/electrum/pull/9141
2024-08-14 20:59:19 +00:00
ghost43
d7014c361d Merge pull request #9141 from dlitz/fixes-for-trezorlib-0.13.9
trezor: Fix for trezor library version 0.13.9
2024-08-14 20:15:10 +00:00
SomberNight
1880c6a749 qt wizard WCWalletName: focus password textedit
- between the Back btn and the Next btn, the latter should have priority for focus
- but if the user needs to enter the wallet password, that textedit should have focus

closes https://github.com/spesmilo/electrum/issues/9157
related c6802adbae
2024-08-13 04:05:03 +00:00
ghost43
e8474e8928 Merge pull request #9160 from timesince/master
chore: fix some comments and var name
2024-08-13 03:34:39 +00:00
ghost43
287cb9ebb6 Merge pull request #9152 from shangchenglumetro/master
chore: fix some comments
2024-08-13 03:32:51 +00:00
SomberNight
16d2f0f9d4 wallet.get_tx_status: fix incorrect feerate for partial txs
The history tab would show an incorrect feerate for partial/unsigned (local) txs,
if they had any p2sh/p2wsh txins. We would just guess the script is p2wpkh, and
use that for the size calc. Now with calling add_info_from_wallet, the correct
size is used to calculate the feerate.

(The gui tx dialogs call add_info_from_wallet independently, so the size/feerate
shown there were already correct.)
2024-08-13 03:20:32 +00:00
timesince
18d90aee4f chore: fix some comments and var name
Signed-off-by: timesince <seekseat@icloud.com>
2024-08-12 01:36:35 +08:00
shangchenglumetro
4064686359 chore: fix some comments 2024-07-26 01:41:36 +08:00
ThomasV
d0693c311f new wizard: set keystore password. fixes #9147 2024-07-22 10:53:39 +02:00
Darsey Litzenberger
8ae2a7868e trezor: Fix for trezor library version 0.13.9
This enables support for the Trezor Safe 5.
2024-07-18 23:22:07 -06:00
SomberNight
76f5d6ceb0 qt gui: clean-up efilter when exiting
related: https://github.com/spesmilo/electrum/issues/6889#issuecomment-2184052577
2024-07-09 14:26:24 +00:00
Sander van Grieken
295ea97f1f digitalbitbox: follow-up 2f3d89f415 2024-07-03 10:53:16 +02:00
Sander van Grieken
83e14794a1 plugin: clean up imports, style 2024-06-19 11:24:13 +02:00
SomberNight
3d6198eff0 trustedcoin: Wallet_2fa.make_unsigned_transaction to use **kwargs
We often forget updating the method signature of Wallet_2fa.make_unsigned_transaction
when changing Abstract_Wallet.make_unsigned_transaction.
2024-06-17 16:55:23 +00:00
SomberNight
2eb51bcbe6 trustedcoin: sanitize error messages coming from 2fa server
related https://github.com/spesmilo/electrum/issues/9096
2024-06-17 16:52:26 +00:00
SomberNight
bec78b4210 util.error_text_str_to_safe_str: truncate long errors
The messages are sometimes logged and sometimes shown to the user,
- for logging we might not want to truncate or have higher limits,
- but when shown to the user, we definitely want to truncate the error text.
It is simplest to just do the truncation here, at the lowest level.

Note that we usually prepend the error text with a header e.g. "[DO NOT TRUST THIS MESSAGE]"
and if the error text is too long, this header at the beginning might get "lost" in some way.
Hence we should truncate the error text.
2024-06-17 16:52:13 +00:00
SomberNight
09e0413d38 trustedcoin: rm dead code (unused server method transfer_credit) 2024-06-17 14:44:42 +00:00
ThomasV
2f3d89f415 prepare for separation of ecc module:
- move encrypt/sign functions elsewhere
- remove local dependencies in ecc.py, ecc_fast.py (except logging)
2024-06-17 13:05:57 +02:00
ThomasV
8409503788 Merge pull request #9082 from SomberNight/202404_tx_taproot
transaction.py: impl taproot key-spends
2024-06-17 12:49:32 +02:00
SomberNight
20d22d26b3 trustedcoin: rm dead code 2024-06-10 20:27:15 +00:00
SomberNight
300b986782 soothe flake8
```
./tests/test_mnemonic.py:249:9: B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
        with self.assertRaises(Exception):
        ^
1     B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
```
2024-06-10 20:22:20 +00:00
SomberNight
f8180c898c mnemonic: make_seed: add sanity-check
When going through the wizard, this case would previously have errored later in the flow. (for '2fa' at least)
2024-06-10 20:14:22 +00:00
SomberNight
a2d5e31838 mnemonic: rename seed_type() fn
Some functions have an argument named "seed_type" in which it was annoying to call the seed_type() fn.
(especially for functions inside the same module)
2024-06-10 20:00:52 +00:00
SomberNight
b95fbbb86f wizard: fix regression: allow passphrase for some '2fa' seeds
fixes https://github.com/spesmilo/electrum/issues/9088
2024-06-10 19:35:56 +00:00
SomberNight
4f7dcc98bd tests: wallet_vertical: re pre-2.7 "2fa" seeds, test both 24 and 25 len 2024-06-10 18:22:59 +00:00
accumulator
784f209d02 Merge pull request #9091 from accumulator/channel_backup_import_nolightning
qml: fix handling of channel backup import on lightning-disabled wallets
2024-06-10 17:28:27 +02:00
accumulator
d1aa65d0b7 Merge pull request #9086 from longxiangqiao/master
chore: fix some comments
2024-06-10 15:21:42 +02:00
Sander van Grieken
8d9bcda36f qml: fix handling of channel backup import on lightning-disabled wallets 2024-06-10 15:07:02 +02:00
longxiangqiao
8b6eb24b81 chore: fix some comments
Signed-off-by: longxiangqiao <longxiangqiao@qq.com>
2024-06-10 14:25:22 +08:00
ThomasV
912e1a3a5b reintroduce 'unlock' command
- the unlock command was replaced by an option to load_wallet,
because some applications (the swapserver plugin) need to be
executed with an unlocked password. Now the swapserver plugin
waits until the wallet is unlocked.
- wallet.unlock now checks password unconditionally, see #8799
2024-06-08 11:10:33 +02:00
SomberNight
1705e47a88 commands: add comment to load_wallet re "unlock" quirk 2024-06-07 16:26:09 +00:00
SomberNight
02a9ab80be interface: nicer error for CA-signed "Hostname mismatch" certs
Previously when encountering a CA-signed cert that failed verification with "Hostname mismatch",
we would
1. erroneously mark it as self-signed
2. save its cert to pin it
3. when connecting to it later, and being served a CA-signed cert, we would reject the connection
  - I think this is because we use the saved cert (the peer cert, just the last cert in the chain) as if it was a root CA,
    and then during the connection we try to verify against that root. This fails as we are served a different root then.
Error logged in step(3):
```
  3.85 | W | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | Cannot connect to main server due to SSL error (maybe cert changed compared to "/home/user/.electrum/testnet/certs/wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion"). Exc: ConnectError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))
```

This commit fixes step(1), we won't mark the cert as self-signed, instead the error is propagated out and the connection closed.
```
 35.05 | I | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")))
```

Compare:
- SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")
  - verify_code=62
- SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1007)')
  - verify_code=18

Note: the verify_code constants look stable, though they might be openssl-specific. I guess that's ok(?)
140540189c/include/openssl/x509_vfy.h.in (L224)
2024-06-07 14:56:03 +00:00
SomberNight
3a305881cc transaction.py: impl taproot key-spends
Add support for key-path-spending taproot utxos into transaction.py.

- no wallet support yet
- add some psbt, and minimal descriptor support
- preliminary work towards script-path spends
2024-06-07 10:58:26 +00:00
SomberNight
7a0bffc3e3 swaps: broadcast_transaction error-handling 2024-06-05 19:00:51 +00:00
ThomasV
6b02364457 follow-up 444b3f3e17: if we bump the fee of a claim tx, we must broadcast because add_transaction will fail 2024-06-05 19:39:14 +02:00
SomberNight
13e2949088 rm some legacy cruft for old python versions 2024-06-05 14:55:48 +00:00
ThomasV
982443eaa3 maybe_cleanup_forwarding: fix crash if payment_key not in self.received_mpp_htlcs 2024-06-05 16:49:33 +02:00
SomberNight
0866581b2c daemon error-handling: fix traceback.format_exception() on old python
The new API for traceback.format_exception was only added in python 3.10 (91e93794d5).
2024-06-05 14:45:28 +00:00
ThomasV
444b3f3e17 swapserver: bump fee of refund tx if needed 2024-06-05 13:49:31 +02:00