1
0
Commit Graph

15686 Commits

Author SHA1 Message Date
SomberNight
8a53a3201c wallet.try_detecting_internal_addresses_corruption: check more addrs
related https://github.com/spesmilo/electrum/issues/8202

For a HD wallet, instead of checking the first 10 addrs + 10 additional random ones,
we now check the first 10 addrs + 10 random used addrs + 10 random unused addrs.
Checking unused addresses is useful to prevent getting money sent there,
and checking used addresses is useful to inform people of already lost money.
2023-02-08 23:32:32 +00:00
SomberNight
90f1279d9a addr_sync: (trivial) don't use private utxo._is_coinbase_output 2023-02-08 23:32:28 +00:00
Sander van Grieken
6b8f9f8fe2 qml: allow ln node connect string without port, default to 9735 2023-02-08 17:31:08 +01:00
Sander van Grieken
6cb6531fd9 qml: add swap progress dialog 2023-02-08 17:12:20 +01:00
ThomasV
1d00b56b64 make ConfirmTxDialog resizeable 2023-02-08 13:28:03 +01:00
Sander van Grieken
c5883c7cdb text guis low hanging fruit 2023-02-08 12:51:24 +01:00
ThomasV
53b7cc3f90 use shared prefix for config keys related to tx editor 2023-02-08 11:34:48 +01:00
ThomasV
6e8e8798c7 feerounding_icon: use transparent background, and disable if not visible 2023-02-08 11:22:02 +01:00
Sander van Grieken
f3b3a40ffe qml: add wallet button icon 2023-02-08 10:37:47 +01:00
SomberNight
b20933de6d payserver: better handle running with --offline
```
 19.70 | E | plugin | Plugin error. plugin: payserver, hook: wallet_export_request
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/plugin.py", line 227, in run_hook
    r = f(*args)
  File "/home/user/wspace/electrum/electrum/plugins/payserver/payserver.py", line 69, in wallet_export_request
    d['view_url'] = self.view_url(key)
  File "/home/user/wspace/electrum/electrum/plugins/payserver/payserver.py", line 55, in view_url
    return self.server.base_url + self.server.root + '/pay?id=' + key
AttributeError: 'NoneType' object has no attribute 'base_url'
```
```
 23.22 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/plugins/payserver/qt.py", line 48, in settings_dialog
    url = self.server.base_url + self.server.root + '/create_invoice.html'
AttributeError: 'NoneType' object has no attribute 'base_url'
```
2023-02-08 01:51:43 +00:00
SomberNight
3ce2986c1f Testing with a wallet with a ~1000 unpaid/expired payment requests,
with the Qt gui, the python process saturates one of my CPU cores to 100%.
This is because main_window.timer_actions() calls request_list.refresh_all()
every 0.5 seconds, which iterates over all unpaid payreqs, and does a
scriptpubkey->address->scriptpubkey conversion.

Trace of the hot path:
```
  File "/home/user/wspace/electrum/./run_electrum", line 510, in <module>
    main()
  File "/home/user/wspace/electrum/./run_electrum", line 421, in main
    handle_cmd(
  File "/home/user/wspace/electrum/./run_electrum", line 439, in handle_cmd
    d.run_gui(config, plugins)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 581, in run_gui
    self.gui_object.main()
  File "/home/user/wspace/electrum/electrum/gui/qt/__init__.py", line 469, in main
    self.app.exec_()
  File "/home/user/wspace/electrum/electrum/gui/qt/main_window.py", line 861, in timer_actions
    self.receive_tab.request_list.refresh_all()
  File "/home/user/wspace/electrum/electrum/gui/qt/util.py", line 821, in refresh_all
    self.refresh_row(key, row)
  File "/home/user/wspace/electrum/electrum/gui/qt/request_list.py", line 126, in refresh_row
    status = self.wallet.get_invoice_status(request)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 2330, in get_invoice_status
    paid, conf = self.is_onchain_invoice_paid(invoice)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 1118, in is_onchain_invoice_paid
    is_paid, conf_needed, relevant_txs = self._is_onchain_invoice_paid(invoice)
  File "/home/user/wspace/electrum/electrum/wallet.py", line 1085, in _is_onchain_invoice_paid
    outputs = invoice.get_outputs()
  File "/home/user/wspace/electrum/electrum/invoices.py", line 130, in get_outputs
    traceback.print_stack()
```

These commits drastically reduce the CPU utilisation.
2023-02-08 00:51:54 +00:00
SomberNight
1e3f9b942f qt: MyTreeView.refresh_all to use maybe_defer_update
In particular, window.timer_actions() calls
request_list.refresh_all() and invoice_list.refresh_all(),
every 0.5 seconds.
We avoid doing this at least when those lists are not visible anyway.
2023-02-08 00:45:18 +00:00
Sebastian Falbesoner
ede9b2b372 transaction: cache address determination from output script
In order to avoid repeatedly calling get_addr_from_output_script() on
every read of the "TxOutput.address" property, determine and cache it
only whenever the output script is created/changed.
2023-02-08 00:41:44 +00:00
SomberNight
71697afabd invoices: get_outputs to use .outputs field if available
It is wasteful to create new PartialTxOutput objects if we already have an outputs field.
Btw apparently lightning invoices too have an outputs field.
2023-02-08 00:40:46 +00:00
ThomasV
bc3946d2f4 Qt: new onchain tx creation flow:
- transaction_dialog is read-only
 - ConfirmTxDialog and RBF dialogs inherit from TxEditor
 - TxEditors are configurable
2023-02-07 16:42:20 +01:00
Sander van Grieken
5eb7bcebef qml: remove ugly notification popup, add wallet name to notifications 2023-02-07 13:55:22 +01:00
Sander van Grieken
c3c308ec0b qml: qewallet logger add wallet name 2023-02-07 13:50:26 +01:00
Sander van Grieken
78d68d00e0 qml: override default Material styling for toolbar, use grays 2023-02-07 12:23:14 +01:00
Sander van Grieken
73004b4993 qml: button min size 2023-02-07 11:54:10 +01:00
Sander van Grieken
393dcde7ae qml: set a minimum button size 2023-02-07 11:49:57 +01:00
Sander van Grieken
9d02f6ee4c qml: shorten text for adding addresses/keys and add add.png icon 2023-02-07 11:40:31 +01:00
Sander van Grieken
2dff6a10ca qml: fix issue with number of addresses in model 2023-02-07 11:18:27 +01:00
Sander van Grieken
9d4e00d582 qml: styling ImportAddressesKeysDialog 2023-02-07 11:10:28 +01:00
Sander van Grieken
db34efd333 qml: silence undefined property errors when not really used 2023-02-07 10:35:34 +01:00
ghost43
899c468c34 Merge pull request #8190 from jsarenik/jsn/signet-on-bublina
signet on bublina
2023-02-06 23:59:02 +00:00
Sander van Grieken
b9b0ada15d qml: better fix 2023-02-07 00:21:21 +01:00
Sander van Grieken
b2d4a2a81f qml: fix show mempool depth when unconfirmed 2023-02-07 00:13:03 +01:00
Sander van Grieken
fa72da57fd Revert "qml: silence undefined property errors when not really used"
This reverts commit ba51cef0d5.
2023-02-07 00:06:05 +01:00
Sander van Grieken
ba51cef0d5 qml: silence undefined property errors when not really used 2023-02-07 00:03:48 +01:00
Sander van Grieken
2cfcf5035d qml: add rocket.png for fee bump icon 2023-02-06 23:57:44 +01:00
Sander van Grieken
99133a65dd followup a844503861 2023-02-06 22:52:38 +01:00
Sander van Grieken
a844503861 qml: move separator visible property binding to its component so our master index ref is stable 2023-02-06 22:49:03 +01:00
Sander van Grieken
049a59f57a qml: move fee bump button below fee amount 2023-02-06 22:49:03 +01:00
Sander van Grieken
ad26d809a4 qml: update history in more cases when saving/removing tx 2023-02-06 22:49:03 +01:00
SomberNight
d3a10c4225 commands: allow cmd to launch new gui window for wallet
e.g. imagine electrum Qt gui is already running, with some wallet (wallet_1) open,
running `$ ./run_electrum --testnet -w ~/.electrum/testnet/wallets/wallet_2` should
open a new window, for wallet_2.

related https://github.com/spesmilo/electrum/issues/8188#issuecomment-1419444675
2023-02-06 17:55:56 +00:00
Sander van Grieken
7adc8b1fbb qml: fix issues with close channel 2023-02-06 13:12:14 +01:00
Sander van Grieken
036a5997c7 qml: fix confusion when dialogs not on top of activeDialog stack are closed 2023-02-06 12:43:54 +01:00
SomberNight
c6b464f1cb gitignore: add .so.* (.so libs regardless of version)
to cover `electrum/libsecp256k1.so.1`
2023-02-06 11:31:56 +00:00
SomberNight
046609c5d2 lnpeer: add note about thread-safety, and some checks
I was calling methods from the Qt console (e.g. peer.pay()) and seeing weird behaviour...
htlc_switch() (running on asyncio thread) was racing with pay() (running on GUI thread).
2023-02-05 22:49:12 +00:00
ThomasV
406b676ce6 Merge pull request #8189 from 1440000bytes/duplicate-asyncio
remove duplicate import
2023-02-05 15:51:29 +01:00
Jan Sarenik
c7a7c54ccd Add another signet electrum server
Running electrs v0.9.11 currently. TLS via nginx.
Always up-to-date info at http://ln.uk.ms/signet.txt
2023-02-05 10:32:11 +01:00
Jan Sarenik
9ef9b9b768 Add ex.signet.bublina.. option for signet explorer 2023-02-05 10:30:09 +01:00
/dev/fd0
d4a6768b40 remove duplicate import 2023-02-05 02:09:25 +05:30
ghost43
0eea47c78d libsecp256k1: update hardcoded .so lib name in binaries (#8186)
follow-up 7d83335e34
2023-02-04 01:36:19 +00:00
SomberNight
c66411f47e contrib/make_libsecp256k1.sh: rm Makefile patch
unneeded since c0cd7de6d4
and in fact buggy since 0bd3e4243c

related https://github.com/spesmilo/electrum/pull/8185#issuecomment-1416171287
2023-02-03 17:36:46 +00:00
SomberNight
240edb4a77 Merge branch '20230203_libsecp' 2023-02-03 17:12:57 +00:00
SomberNight
7d83335e34 bump libsecp256k1 version
now there are tags :O
2023-02-03 17:11:16 +00:00
SomberNight
dd141c7fa0 libsecp256k1: add runtime support for both 0.2.x and <0.2.0 lib vers
related:
https://github.com/spesmilo/electrum/pull/8185
https://github.com/bitcoin-core/secp256k1/pull/1055
2023-02-03 17:09:51 +00:00
Sander van Grieken
f8e43b3149 qml: styling MessageDialog 2023-02-03 17:27:12 +01:00
Sander van Grieken
3cd3212921 qml: show correct delete confirm text for channel backups 2023-02-03 17:13:44 +01:00