1
0
Commit Graph

16356 Commits

Author SHA1 Message Date
Sander van Grieken
ae12d236b2 qml: fix broadcastFailed signal connections in txdetails (fixes #8384) 2023-05-04 01:15:25 +02:00
Sander van Grieken
3b31e68a86 update release notes 2023-05-04 01:11:35 +02:00
Sander van Grieken
2eaf3dcc64 qml: cleanup 2023-05-03 22:50:58 +02:00
Sander van Grieken
0be8beb9c4 qml: add secure flag to WalletDetails, set when seed is shown 2023-05-03 22:41:25 +02:00
SomberNight
56fa832563 wallet.get_tx_parents: explicitly handle missing "from address"
(happened to work even without this)
2023-05-03 15:08:56 +00:00
SomberNight
a1bfea6121 wallet.get_tx_parents: fix: tx should not be its own uncle
```
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp0. entered for txid='407d03126255cce62a1101075db906587bd492f512166119d3f87b8a1b013497'
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp4.1. parents=['e2d915520f6d42273158a6fd08b38d812bd554aa906d3ed45d103757d45af2bb']
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp4.2. uncles=[]
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp2. populating cache... _txid='434808dab0c93715bb8b7ce85f73bffd0bdf7c1ba205fe0f704226646971e555'
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp0. entered for txid='434808dab0c93715bb8b7ce85f73bffd0bdf7c1ba205fe0f704226646971e555'
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp3.0. uncle_txid='434808dab0c93715bb8b7ce85f73bffd0bdf7c1ba205fe0f704226646971e555'
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp3.1. reuse_height=-2 reuse_pos=-1
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp3.2. my_height=1338 my_pos=1
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp4.1. parents=['407d03126255cce62a1101075db906587bd492f512166119d3f87b8a1b013497']
  3.06 | I | w/wallet.Standard_Wallet.[default_wallet] | get_tx_parents() cp4.2. uncles=['434808dab0c93715bb8b7ce85f73bffd0bdf7c1ba205fe0f704226646971e555']
 40.82 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 846, in timer_actions
    self.update_wallet()
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1001, in update_wallet
    self.update_tabs()
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 1013, in update_tabs
    self.utxo_list.update()
  File "/home/user/wspace/electrum/electrum/util.py", line 470, in <lambda>
    return lambda *args, **kw_args: do_profile(args, kw_args)
  File "/home/user/wspace/electrum/electrum/util.py", line 465, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/wspace/electrum/electrum/gui/qt/utxo_list.py", line 115, in update
    self.refresh_row(name, idx)
  File "/home/user/wspace/electrum/electrum/gui/qt/utxo_list.py", line 137, in refresh_row
    num_parents = self.wallet.get_num_parents(txid)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 897, in get_num_parents
    self._num_parents[txid] = len(self.get_tx_parents(txid))
  File "/home/user/wspace/electrum/electrum/wallet.py", line 910, in get_tx_parents
    self.get_tx_parents(_txid)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 938, in get_tx_parents
    p = self._tx_parents_cache[_txid]
KeyError: '434808dab0c93715bb8b7ce85f73bffd0bdf7c1ba205fe0f704226646971e555'
```
2023-05-03 15:06:37 +00:00
SomberNight
5512c7d905 wallet.get_tx_info: distinguish "future" tx from local in "status" str
closes https://github.com/spesmilo/electrum/issues/8379
2023-05-03 14:15:08 +00:00
SomberNight
53d61c011a qml network: restrict cases where server is shown "lagging" 2023-05-03 13:49:44 +00:00
SomberNight
3bdda3a861 config: force 'history_rates' config var to bool
fixes https://github.com/spesmilo/electrum/issues/8367

probably regression from 503776c0de
(note that before that commit, we were casting to bool)
2023-05-03 12:18:34 +00:00
Sander van Grieken
1a889d19b5 Merge branch 'seed_keyboard' 2023-05-03 11:47:52 +02:00
Sander van Grieken
c8c76a8d6f qml: fix var ref 2023-05-02 20:16:36 +02:00
SomberNight
33d394c9d7 ledger: fix scan_devices for certain devices with multiple interfaces
regression from https://github.com/spesmilo/electrum/pull/8041 (4.3.3)

maybe fixes https://github.com/spesmilo/electrum/issues/8293

-----

Testing with a "Ledger Nano S", btc app version 1.6.3.
btchip-python==0.1.32
ledgercomm==1.1.1
ledger-bitcoin==0.1.1

Trying to scan devices hangs/blocks forever on Linux (ubuntu 22.04).

```patch
diff --git a/electrum/plugins/ledger/ledger.py b/electrum/plugins/ledger/ledger.py
index 17c1caca48..ba5ae2e3ee 100644
--- a/electrum/plugins/ledger/ledger.py
+++ b/electrum/plugins/ledger/ledger.py
@@ -306,17 +306,25 @@ class Ledger_Client(HardwareClientBase, ABC):
     @staticmethod
     def construct_new(*args, device: Device, **kwargs) -> 'Ledger_Client':
         """The 'real' constructor, that automatically decides which subclass to use."""
+        _logger.info(f"xxx construct_new(). cp1. {device.path=}. {device=}")
         if LedgerPlugin.is_hw1(device.product_key):
             return Ledger_Client_Legacy_HW1(*args, **kwargs, device=device)
         # for nano S or newer hw, decide which client impl to use based on software/firmware version:
+        _logger.info(f"xxx construct_new(). cp2.")
         hid_device = HID()
         hid_device.path = device.path
+        _logger.info(f"xxx construct_new(). cp3.")
         hid_device.open()
+        _logger.info(f"xxx construct_new(). cp4.")
         transport = ledger_bitcoin.TransportClient('hid', hid=hid_device)
-        cl = ledger_bitcoin.createClient(transport, chain=get_chain())
+        _logger.info(f"xxx construct_new(). cp5.")
+        cl = ledger_bitcoin.createClient(transport, chain=get_chain(), debug=True)
+        _logger.info(f"xxx construct_new(). cp6.")
         if isinstance(cl, ledger_bitcoin.client.NewClient):
+            _logger.info(f"xxx construct_new(). cp7. trying Ledger_Client_New")
             return Ledger_Client_New(hid_device, *args, **kwargs)
         else:
+            _logger.info(f"xxx construct_new(). cp7. trying Ledger_Client_Legacy")
             return Ledger_Client_Legacy(hid_device, *args, **kwargs)

     def __init__(self, *, plugin: HW_PluginBase):
@@ -1416,7 +1424,7 @@ class LedgerPlugin(HW_PluginBase):
         try:
             return Ledger_Client.construct_new(device=device, product_key=device.product_key, plugin=self)
         except Exception as e:
-            self.logger.info(f"cannot connect at {device.path} {e}")
+            self.logger.info(f"cannot connect at {device.path} {e}")  #
         return None

     def setup_device(self, device_info, wizard, purpose):
```

scanning devices freezes... log:
```
  8.94 | I | plugin.DeviceMgr | scanning devices...
  9.18 | D | util.profiler | DeviceMgr.scan_devices 0.2357 sec
  9.18 | I | plugins.ledger.ledger | xxx construct_new(). cp1. device.path=b'0001:0008:00'. device=Device(path=b'0001:0008:00', interface_number=0, id_="b'0001:0008:00',0001,0,0", product_key=(11415, 4117), usage_page=0, transport_ui_string='hid')
  9.18 | I | plugins.ledger.ledger | xxx construct_new(). cp2.
  9.18 | I | plugins.ledger.ledger | xxx construct_new(). cp3.
heyheyhey. cp1. self.path=b'0001:0008:00'
  9.18 | I | plugins.ledger.ledger | xxx construct_new(). cp4.
  9.18 | I | plugins.ledger.ledger | xxx construct_new(). cp5.
=> b001000000
<= 010c426974636f696e205465737405312e362e3301029000
  9.22 | I | plugins.ledger.ledger | xxx construct_new(). cp6.
  9.22 | I | plugins.ledger.ledger | xxx construct_new(). cp7. trying Ledger_Client_Legacy
  9.29 | I | plugin.DeviceMgr | Registering <electrum.plugins.ledger.ledger.Ledger_Client_Legacy object at 0x7f4369e6e380>
 10.33 | I | plugins.ledger.ledger | xxx construct_new(). cp1. device.path=b'0001:0008:01'. device=Device(path=b'0001:0008:01', interface_number=1, id_="b'0001:0008:01',0001,1,0", product_key=(11415, 4117), usage_page=0, transport_ui_string='hid')
 10.33 | I | plugins.ledger.ledger | xxx construct_new(). cp2.
 10.33 | I | plugins.ledger.ledger | xxx construct_new(). cp3.
heyheyhey. cp1. self.path=b'0001:0008:01'
 10.33 | I | plugins.ledger.ledger | xxx construct_new(). cp4.
 10.33 | I | plugins.ledger.ledger | xxx construct_new(). cp5.
=> b001000000
```

in Qt console (before change):
```
>>> lp = plugins.get_plugin("ledger")
>>> plugins.device_manager.scan_devices()
[Device(path=b'0001:000a:00', interface_number=0, id_="b'0001:000a:00',0001,0,0", product_key=(11415, 4117), usage_page=0, transport_ui_string='hid'), Device(path=b'0001:000a:01', interface_number=1, id_="b'0001:000a:01',0001,1,0", product_key=(11415, 4117), usage_page=0, transport_ui_string='hid')]
```
2023-05-02 17:23:07 +00:00
SomberNight
7f52415807 util: add some logging to NetworkJobOnDefaultServer starting/stopping
to help debug claims of Synchronizer maybe getting stuck
2023-05-02 13:41:47 +00:00
Sander van Grieken
0672ea20ab qml: implement toggle for android SECURE_FLAG and add marker to wizard pages
that should be secured.
2023-05-02 15:16:51 +02:00
Sander van Grieken
8cd26820bf qml: styling seedtextarea 2023-05-02 13:56:55 +02:00
Sander van Grieken
95f960bb67 qml: seedtext word suggestions below text area 2023-05-02 13:04:33 +02:00
Sander van Grieken
b290fbd4b5 qml: seedkeyboard padding, explicit keycode, backspace next to spacebar 2023-05-02 13:03:13 +02:00
ThomasV
8a25d59ba6 wallet: save num_parents of utxos in wallet file.
fixes #8361
2023-05-02 09:27:39 +02:00
ThomasV
6d392a67f9 wallet.get_tx_parents: populate cache regardless of self.is_up_to_date()
Fixes #8315
2023-05-02 09:11:21 +02:00
Sander van Grieken
6394cdcd3b qml: disable Qt Virtual Keyboard and refactor keyboardFreeZone item to take
android system keyboard into account
2023-05-01 18:39:16 +02:00
Sander van Grieken
9ac83f6d9f qml: add SeedKeyboard for seed entry without using system virtual keyboard 2023-05-01 16:59:40 +02:00
Sander van Grieken
5600375d51 qml: no auto caps on import and master key controls 2023-04-29 14:30:25 +02:00
Sander van Grieken
56165c3790 qml: don't start loadWallet if daemon is busy loading. 2023-04-29 14:13:12 +02:00
Sander van Grieken
1b362f64f2 qml: properly delete wizard components after use. fixes #8357 2023-04-29 13:57:16 +02:00
Sander van Grieken
db53b0f573 qml: fix 2fa callback issue #8368 2023-04-29 12:05:25 +02:00
SomberNight
155258f208 release.sh: check we have each binary (RM case)
~duplicated from the non-RM case
2023-04-27 17:36:09 +00:00
SomberNight
22b8c4e397 hww: fix digitalbitbox(1) support
regression from cea4238b81

```
975.04 | E | plugin.DeviceMgr | failed to create client for digitalbitbox at <REDACTED>: AttributeError("'NoneType' object has no attribute 'get_passphrase'")
Traceback (most recent call last):
  File "...\electrum\electrum\plugin.py", line 620, in list_pairable_device_infos
    soft_device_id = client.get_soft_device_id()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 251, in get_soft_device_id
    root_fp = self.request_root_fingerprint_from_device()
  File "...\electrum\electrum\plugin.py", line 362, in wrapper
    return run_in_hwd_thread(partial(func, *args, **kwargs))
  File "...\electrum\electrum\plugin.py", line 352, in run_in_hwd_thread
    return func()
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 264, in request_root_fingerprint_from_device
    child_of_root_xpub = self.get_xpub("m/0'", xtype='standard')
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 115, in get_xpub
    reply = self._get_xpub(bip32_path)
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 110, in _get_xpub
    if self.check_device_dialog():
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 197, in check_device_dialog
    if not self.password_dialog(msg):
  File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 159, in password_dialog
    password = self.handler.get_passphrase(msg, False)
AttributeError: 'NoneType' object has no attribute 'get_passphrase'
```
2023-04-27 17:33:54 +00:00
SomberNight
499f51535f bip32: fix hardened char "h" vs "'" compatibility for some hw wallets
in particular, ledger: fix sign_message for some wallets

```
156.02 | E | plugins.ledger.ledger |
Traceback (most recent call last):
  File "...\electrum\electrum\plugins\ledger\ledger.py", line 1265, in sign_message
    result = base64.b64decode(self.client.sign_message(message, address_path))
  File "...\Python310\site-packages\ledger_bitcoin\client.py", line 230, in sign_message
    sw, response = self._make_request(self.builder.sign_message(message_bytes, bip32_path), client_intepreter)
  File "...\Python310\site-packages\ledger_bitcoin\command_builder.py", line 176, in sign_message
    bip32_path: List[bytes] = bip32_path_from_string(bip32_path)
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in bip32_path_from_string
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
  File "...\Python310\site-packages\ledger_bitcoin\common.py", line 68, in <listcomp>
    return [int(p).to_bytes(4, byteorder="big") if "'" not in p
ValueError: invalid literal for int() with base 10: '84h'
```

Regression from df2bd61de6, where the
default hardened char was changed from "'" to "h". Note that there was
no corresponding wallet db upgrade, so some files use one char and
others use the other.
2023-04-27 17:03:16 +00:00
SomberNight
9e1bb940ac prepare release 4.4.1 4.4.1 2023-04-27 11:11:29 +00:00
SomberNight
4416f73592 update locale submodule 2023-04-27 11:08:05 +00:00
SomberNight
f5f177f7e8 qml wizard: fix restoring from old mpk (watchonly for "old" seeds)
fixes https://github.com/spesmilo/electrum/issues/8356
2023-04-27 09:34:23 +00:00
SomberNight
87909485c5 qml: wizard to check if wallet name is already used
was erroring at the very last moment previously
2023-04-27 08:47:02 +00:00
SomberNight
57ae933582 (trivial) add some type hints to wallet.get_tx_parents 2023-04-26 18:11:55 +00:00
ghost43
ac7a9c3642 Merge pull request #8329 from SomberNight/202304_secp_debian
README: refer to `libsecp256k1-dev` instead of `libsecp256k1-0`
2023-04-26 17:02:17 +00:00
SomberNight
910832c153 transaction: calc and cache TxInput/TxOutput.address on-demand
In one wallet, before this, make_unsigned_transaction() took 120 sec,
now it takes ~8 sec.

hot path:
```
make_unsigned_transaction (electrum/wallet.py:1696)
add_input_info (electrum/wallet.py:2261)
utxo (electrum/transaction.py:289)
tx_from_any (electrum/transaction.py:1232)
deserialize (electrum/transaction.py:805)
<listcomp> (electrum/transaction.py:805)
parse_output (electrum/transaction.py:706)
__init__ (electrum/transaction.py:127)
scriptpubkey (electrum/transaction.py:173)
get_address_from_output_script (electrum/transaction.py:672)
```
2023-04-26 16:54:13 +00:00
ThomasV
8dca907891 get_tx_parent: populate cache in chronological order 2023-04-26 18:29:46 +02:00
SomberNight
ad5f95cb87 util.profiler: add "min_threshold" arg 2023-04-26 14:49:37 +00:00
SomberNight
ee52154542 transaction: TxInput: store addr/spk/value_sats, instead of re-calc
We were re-calculating txin.address from the prevtx-utxo on every call,
e.g. in electrum/gui/qt/utxo_list.py#L103 (for every utxo in the wallet).

For a wallet with ~1300 utxos, UTXOList.update() took ~3.2 sec before this,
now it's ~0.8 sec.
2023-04-26 13:08:27 +00:00
SomberNight
312e50e9a9 qml: send screen: bip21: fallback to onchain addr if no LN channels
given a bip21 uri that has both onchain addr and bolt11,
if we have LN enabled but no LN channels, auto-fallback to paying onchain

we will have to clean up and unify this logic between GUIs. becoming spaghetti :/
rumour has it, Thomas has a branch? :P
2023-04-25 22:23:24 +00:00
SomberNight
5b122e723f follow-up prev: re-add some newlines 2023-04-25 18:19:19 +00:00
SomberNight
55140a9e27 gui/messages.py: allow localization of these strings 2023-04-25 17:54:07 +00:00
Sander van Grieken
663ea431f6 followup 61179ede8c 2023-04-25 14:22:19 +02:00
Sander van Grieken
a23457f48d qml: consistency camelcase pyqtProperties 2023-04-25 14:15:13 +02:00
Sander van Grieken
e26d49f11e qml: consistency camelcase public slots qetxdetails, qelnpaymentdetails, qechannelopener, qeaddressdetails 2023-04-25 13:46:30 +02:00
Sander van Grieken
264540e12b qml: consistency camelcase public slots qedaemon, qeinvoice, qewizard 2023-04-25 13:40:16 +02:00
Sander van Grieken
61179ede8c qml: consistency camelcase qewallet 2023-04-25 13:33:15 +02:00
Sander van Grieken
f0bbbe9955 qml: consistency camelcase public slots listmodels 2023-04-25 13:22:34 +02:00
Sander van Grieken
2b091b283a qml: qebitcoin remove unused code, fix scoping, camelcase 2023-04-25 13:04:09 +02:00
Sander van Grieken
96fd339a52 qml: followup 22fa84a0, use fixed font, use camelcase for QML properties 2023-04-25 12:46:30 +02:00
ghost43
664544886a Merge pull request #8318 from SomberNight/202304_qt_bumpfee
qt bump fee: disallow targeting an abs fee. only allow setting feerate
2023-04-24 16:56:53 +00:00