1
0
Commit Graph

17599 Commits

Author SHA1 Message Date
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
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
SomberNight
90136f0de5 (trivial) fix some import orders
1. stdlib
2. 3rd-party
3. internal

(as in PEP-8)
2024-06-04 18:29:17 +00:00
SomberNight
bc57926498 network: (trivial) simplify send_http_on_proxy 2024-06-04 13:48:37 +00:00
SomberNight
fab567db3a lnurl: better error messages
re https://github.com/spesmilo/electrum/issues/9078
2024-06-04 13:42:57 +00:00
SomberNight
af2c9b081c util: add AsyncHangDetector, and use it for lnpeer._process_message 2024-06-03 18:36:08 +00:00
SomberNight
eb6e503556 lnworker: follow-up prev: add some nuance to peer-collision-handling
e.g. existing peer might not have a working socket
2024-06-03 17:09:01 +00:00
ThomasV
0c48fd495f lnworker: if two instances of the same wallet are trying to connect
simultaneously, give priority to the existing connection
2024-06-03 18:34:47 +02:00
accumulator
ae1a3e75cd Merge pull request #9077 from jinjiadu/master
chore: fix comment
2024-06-01 10:14:47 +02:00
jinjiadu
e86c05177f chore: fix comment
Signed-off-by: jinjiadu <jinjiadu@aliyun.com>
2024-06-01 15:01:08 +08:00
accumulator
15f13ebc66 Merge pull request #9076 from SomberNight/202405_android_config_pin
qml: "wallet_else_pin" auth should only use the wallet pw if is unified
2024-05-31 11:14:50 +02:00
SomberNight
db5f1a11a5 fix typo
note: "everytime" even appears in the old_mnemonic wordlist, but it is a misspelling.
2024-05-30 16:59:28 +00:00
SomberNight
11614f035d qml: "wallet_else_pin" auth should only use the wallet pw if is unified
related https://github.com/spesmilo/electrum/pull/9074
2024-05-30 16:17:21 +00:00
ghost43
183bdd1464 Merge pull request #9073 from accumulator/android_qr_scanner_fix
qml: don't unbind/unregister the ActivityResultListener from within the ActivityResultListener handler func
2024-05-30 15:51:26 +00:00
ThomasV
31884895aa wallet_db: show electrum version in error dialog 2024-05-30 17:19:23 +02:00
ghost43
e3eb59f01d Merge pull request #9074 from accumulator/issue_8366
qml: don't rely on wallet when deactivating PIN and no wallet loaded (fixes #8366)
2024-05-30 15:16:46 +00:00
Sander van Grieken
8085c41cfb qml: don't rely on wallet when deactivating PIN and no wallet loaded (fixes #8366) 2024-05-30 15:23:25 +02:00
SomberNight
73989e7a1b bip21: trivial follow-up
follow-up bb4ee2b50b
2024-05-30 13:08:13 +00:00
SomberNight
c5ac0b341f release.sh: print warning on unexpected arg value
I keep mixing up sombernight and sombernight_releasekey.
2024-05-30 12:54:00 +00:00
Sander van Grieken
450b9a03ce qml: don't unbind/unregister the ActivityResultListener from within the ActivityResultListener handler func.
instead, schedule a queued finished signal to unregister the listener after the handler has finished.
See PythonActivity.java in P4A for why this probably causes the most often occurring crash we see on the Play Store:

```
Exception java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5164)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:5205)
  at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:51)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2136)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:8061)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by java.util.ConcurrentModificationException:
  at java.util.ArrayList$Itr.next (ArrayList.java:860)
  at org.kivy.android.PythonActivity.onActivityResult (PythonActivity.java:218)
  at android.app.Activity.dispatchActivityResult (Activity.java:8501)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5157)
```
2024-05-30 14:53:33 +02:00
SomberNight
ef536493ee update release notes for version 4.5.5 2024-05-29 17:05:48 +00:00
Sander van Grieken
3d189d99a5 followup 4159ceee35 2024-05-29 16:59:00 +02:00
SomberNight
3bd8e4aa4e update locale 2024-05-29 14:56:04 +00:00
SomberNight
0f89b8d4bc update block header checkpoints 2024-05-29 14:44:24 +00:00
SomberNight
ebbdadb080 ci: follow-up: build own libsecp256k1 instead of using apt
follow-up dbc69727bd
2024-05-29 13:30:49 +00:00
Sander van Grieken
4159ceee35 qt: fix ReceiveWidget layout (fixes #9049) 2024-05-29 15:14:23 +02:00
ghost43
9214291cdb Merge pull request #9072 from SomberNight/202405_bump_secp
bump libsecp256k1 version (0.4.1->0.5.0)
2024-05-29 12:46:43 +00:00
Sander van Grieken
9674ffc8ee bip21: add testcases for amount bounds 2024-05-29 10:22:28 +02:00
Sander van Grieken
bb4ee2b50b bip21: consider amount=0 in bip21 uri invalid 2024-05-29 10:12:43 +02:00
SomberNight
dbc69727bd ci: unittests: build own libsecp256k1 instead of using apt
related 6bf7542b25
2024-05-28 17:13:17 +00:00
SomberNight
2eee98b493 bump libsecp256k1 version (0.4.1->0.5.0) 2024-05-28 17:09:44 +00:00
SomberNight
7827be17d1 qt wizard: fix offline 2fa wallet creation in some cases
fixes https://github.com/spesmilo/electrum/issues/9037
2024-05-28 15:31:37 +00:00
SomberNight
e8a9e45291 qml wizard: even stricter validation for new wallet name
related: 07dc80dd9a
2024-05-28 14:20:28 +00:00
ghost43
9f74ba4e8c Merge pull request #9070 from SomberNight/202405_ecc_ecdsa_low_s
ecc: ecdsa_verify to enforce low-S rule
2024-05-28 13:20:08 +00:00