1
0
Commit Graph

17323 Commits

Author SHA1 Message Date
SomberNight
a749fd7789 qt tx_dialog: share btn: add option to add slip-19 ownership proofs 2024-02-21 11:58:52 +00:00
SomberNight
b7ed016f3c qt tx_dialog: share btn: replace nested menus with checkboxes
Incidentally, the checkboxes are using the config, so their state is persisted.
2024-02-21 11:56:18 +00:00
SomberNight
0925f15280 wallet/keystore: add apis for "add_slip_19_ownership_proofs_to_tx"
- implement it specifically for the "singlesig trezor" case
- aimed to be generic enough that support for more complex scripts
  and other keystores could be added later
2024-02-21 11:56:13 +00:00
SomberNight
c84e55e957 wallet: (trivial) simplify class hierarchy
legacy cruft
2024-02-05 12:47:20 +00:00
Sander van Grieken
0a6b2d521b qml: move final wizard submit() to WizardComponent.finish handler 2024-02-05 11:13:58 +01:00
accumulator
019baa5a71 Merge pull request #8862 from SomberNight/202401_qml_wizard_final_accept
qml wizard: run navmap[view]['accept'] handler a final time on finish
2024-02-05 10:46:22 +01:00
SomberNight
87214c004e trezor: don't try to sign non-ismine inputs
progress towards coinjoin

related https://github.com/spesmilo/electrum/issues/8868
2024-02-05 07:21:28 +00:00
SomberNight
07dc80dd9a qml wizard: stricter validation for new wallet name
user on bitcointalk [0] tried to create wallet with name "w/o 2FA".
Before this, one would only get an error after the last page of the wizard.
With this, the "Next" button does not even get enabled if the name does not look ok.
(and as in comment, maybe we should be even stricter re what is allowed)

[0]: https://bitcointalk.org/index.php?topic=5483514.msg63584789#msg63584789
2024-02-04 08:54:40 +00:00
SomberNight
1d4e2ebed6 ConfigVar: add "converter" for getter, add use it for "proxy" key
fixes https://github.com/spesmilo/electrum/issues/8837

Alternatively we could do a config upgrade (convert_version_*) to fix that specific issue,
but they are not safe against downgrade-upgrade-again, so probably not the best choice for
crash-inducing values.
And this kind of converter is a generic solution that can be useful for other configvars later
(though for most usages I expect we will also need a converter for the setter).
2024-02-04 07:20:05 +00:00
SomberNight
3e81cd1f1d trezor: fix regression in sign_transaction for trezor one for multisig
fixes https://github.com/spesmilo/electrum/issues/8813
regression from eef9680743

We started setting the witness field in above commit to be able to provide the witnesses for already pre-signed
external inputs to the device, e.g. for a coinjoin.

Trezor One fw has pretty strict limits on the witness field: max 109 bytes,
probably because that's a ~tight upper bound for a p2wpkh witness:
  <num_witness_items> <len(sig)> <sig> <len(pubkey)> <pubkey>, it comes out to 3+73(high-S and high-R)+33.
ed1785a985/legacy/firmware/protob/messages-bitcoin.options (L35)

Trezor model T seems to have higher limits.

tx_inputs is called for the tx being signed (for_sig=True), and for its parents/prev_txes (for_sig=False).
The witness is only useful for the tx being signed, I think.

Users reported seeing a "DataError: bytes overflow" exception when using a Trezor One to sign 2of3 p2wsh multisig txs.
There were no external inputs involved so for the tx being signed all witnesses were None, however we were also
setting the witness for the inputs of prev_txes.
The witness for a 2of3 pw2sh multisig input is around ~253 bytes.

To sidestep the problem, we now only set the witness in the for_sig=True case.
Note that this means if someone tries to do a coinjoin with a Trezor One involving non-trivial external inputs,
they will run into the same limit and exception.
2024-02-04 00:14:59 +00:00
SomberNight
ca206de16b qt NetworkDialog: small clean-up 2024-02-03 11:52:33 +00:00
SomberNight
b80f975894 config: rm some dead code 2024-02-03 11:52:29 +00:00
SomberNight
a9a8ed2eb4 follow-up: factor out more hardcoded "sat/byte" and "sat/b" strings
- rename globals
- also rm hardcoded strings from qml
- use consistent unit names in qml
  (previously mixed sat/vB and sat/byte (latter coming from core lib))
2024-02-03 05:26:31 +00:00
SomberNight
13a421aabb factor out hardcoded "sat/byte" and "sat/b" strings
Though note that the qml GUI has some more in qml/js context.
2024-02-03 04:18:46 +00:00
SomberNight
16eec8daf5 qml QEChannelDetails: show currentFeerate
related https://github.com/spesmilo/electrum/issues/8863
2024-02-03 03:43:16 +00:00
SomberNight
d7a9e2d022 qml QEChannelDetails: add some type hints 2024-02-03 03:35:54 +00:00
SomberNight
48a96f6776 qml wizard: run navmap[view]['accept'] handler a final time on finish
For example, see
061c821128/electrum/plugins/trustedcoin/trustedcoin.py (L624)
Even if navmap[view]['last'] is True, we still want the navmap[view]['accept'] handler to run.

fixes https://github.com/spesmilo/electrum/issues/8861

---

Note that an analogous issue does not exist for the desktop qt gui,
see 061c821128/electrum/gui/qt/wizard/wizard.py (L206)
There, wizard.resolve_next is called regardless of is_last.
2024-01-31 12:59:47 +00:00
ThomasV
061c821128 Merge pull request #8843 from SomberNight/202401_jsondb_set
walletdb: change structure of prevouts_by_scripthash, and db upgrade
2024-01-31 12:56:11 +01:00
SomberNight
acae6751d2 wizard: do not log sensitive data (add more keys, again)
frankly this blacklist approach seems too fragile...
2024-01-31 11:23:45 +00:00
SomberNight
cb55c65677 qml wizard: WCWalletPassword: show warning if pw is too short 2024-01-31 10:28:10 +00:00
SomberNight
cc19a86262 lnutil: nicer repr for some attrs data classes 2024-01-31 09:24:42 +00:00
SomberNight
e6a0455ced lnpeer: raise chan fees using update_fee more aggressively
The existing logic of only updating the fee if it is not within 2x of
the current 2-block-eta does not work well for the current mempool.

The current mempool looks a bit weird: you need ~20 sat/vbyte to even get into it,
but there is only around 5 MB of txs paying >25 sat/vbyte.
The estimates look like this:
```
>>> config.fee_estimates
{144: 25764, 25: 27075, 10: 34538, 5: 34538, 2: 34538}
```

This commit changes the logic so that we send update_fee if the old rate is
- below 75% of the current 2-block-eta (instead of 50%), or
- below the 25-block-eta
2024-01-31 08:47:29 +00:00
SomberNight
e7ebf5d950 qt wizard: handle some cases of hw device being unplugged during flow
To reproduce, open two wizards in parallel. Use one to enter the flow and start creating a wallet,
then physically unplug the hw device at the correct time, and use the other wizard to trigger a rescan.
The rescan will unpair the hw device, resulting in device_manager.client_by_id to return None when
continuing the flow on the first wizard.

fixes https://github.com/spesmilo/electrum/issues/8858
2024-01-31 04:02:02 +00:00
SomberNight
67b57da402 qml: WCHaveMasterKey: (fix) re-verify text in onTextChanged
fixes https://github.com/spesmilo/electrum/issues/8853

This is a bit ugly, but activeFocus is declared as final and cannot be overridden directly...
```
  1.42 | W | gui.qml.qeapp | file:///home/user/wspace/electrum/electrum/gui/qml/components/controls/ElTextArea.qml:23:5: Cannot override FINAL property
```
2024-01-30 02:11:01 +00:00
SomberNight
522e9485c1 text gui: rm some magic numbers (ascii key codes), and small clean-up 2024-01-23 23:43:08 +00:00
Sander van Grieken
bd7adc83b3 exchange_rate: don't show ridiculous precision for alts 2024-01-23 11:48:25 +01:00
SomberNight
cbece71894 walletdb: rm some dead code 2024-01-23 02:20:01 +00:00
SomberNight
1734042293 jsondb: raise when trying to store sets in the db
Some generic protection to prevent bugs similar to what was just fixed in prev commits.
related https://github.com/spesmilo/electrum/issues/8842
2024-01-23 01:53:10 +00:00
SomberNight
79aba5364c walletdb: change structure of prevouts_by_scripthash, and db upgrade
this fixes the test case added in prev
2024-01-23 01:53:06 +00:00
SomberNight
4b28bfc323 tests: walletdb: add failing test case for persistence with jsonpatch
add reproducer for https://github.com/spesmilo/electrum/issues/8842
2024-01-23 01:53:03 +00:00
SomberNight
bb226e653e tests: simplify TestWalletStorage.imported_add_privkeys_persistence 2024-01-23 01:42:09 +00:00
SomberNight
cd3be429e4 qt: PayToEdit: always use monospace font 2024-01-23 00:49:03 +00:00
Sander van Grieken
28042c61c1 qml: trustedcoin: remove redundant slot parameter in createKeystore 2024-01-22 13:32:59 +01:00
Sander van Grieken
50a53aaedc qml: handle 2fa wallet can have None for billing_info 2024-01-22 13:30:46 +01:00
SomberNight
def1abfca5 tests: test_mnemonic: extend test_random_seeds 2024-01-22 03:27:24 +00:00
SomberNight
ad95f8ad56 mnemonic: add comments 2024-01-22 03:27:20 +00:00
SomberNight
7007a0c1c9 mnemonic: add type hints 2024-01-22 03:27:17 +00:00
SomberNight
fe03fbf2a0 prepare release 4.5.2 4.5.2 2024-01-19 16:23:24 +00:00
SomberNight
7247130aaf adb: get_balance: add comment about #8835
> These kind of checks look incorrect and confused/confusing for me:
> 43a5d03426/electrum/gui/qml/qeinvoice.py (L388)
> 43a5d03426/electrum/gui/qt/main_window.py (L1801)

> For example, consider creating a local tx that spends all UTXOs in the wallet, and consolidates them to another ismine address.
> Such a tx basically does not change what wallet.get_balance() returns.
> but to the checks listed above, the confirmed balance of the wallet I guess should be 0?
2024-01-19 15:22:28 +00:00
SomberNight
43a5d03426 qt: coins tab: also define sort order for coins mined in same block
follow-up 0f55a1e309
2024-01-19 14:34:33 +00:00
Sander van Grieken
9518bd0e68 qt: replace timer based delayed call with a less confusing event loop queued call 2024-01-19 14:57:55 +01:00
Sander van Grieken
17147732fb qt: fix macOS workaround introducing race 2024-01-19 14:54:23 +01:00
SomberNight
9fd16cd677 follow-up prev 2024-01-19 13:19:44 +00:00
SomberNight
0f55a1e309 qt: coins tab: properly sort unconfirmed/local utxos to top 2024-01-19 13:12:36 +00:00
SomberNight
f98e986345 prepare release 4.5.1 4.5.1 2024-01-18 17:14:41 +00:00
SomberNight
77f6c932ae release notes for 4.5.1: small clarification 2024-01-18 17:11:07 +00:00
accumulator
1b65c301b5 Merge pull request #8828 from spesmilo/release_notes_4_5_1
add release notes for 4.5.1
2024-01-18 18:04:56 +01:00
Sander van Grieken
1f5004320b qt: re-add processEvents() calls for abstract wizard.
might work around #8809/#8815
2024-01-18 17:55:52 +01:00
SomberNight
060b30cf71 add release notes for 4.5.1 2024-01-18 17:53:24 +01:00
ThomasV
2390a76d1f update locale 2024-01-18 17:01:31 +01:00