1
0
Commit Graph

15344 Commits

Author SHA1 Message Date
SomberNight
253150cb36 qt network dialog: don't poll Tor socks proxy, but scan on interaction
Polling is introduces spam in Tor logs.
Also, Tor Browser 12.0 apparently has a bug where our polling renders
the socks proxy unusuable after some time.
see https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41549

Instead of trying to detect a Tor socks proxy every 10 seconds, we now
run detection when the Qt network dialog gets opened, and also when
the user switches to the "Proxy" tab in the dialog.

fixes https://github.com/spesmilo/electrum/issues/7317
2023-01-02 11:58:16 +00:00
SomberNight
e3485de496 qt gui: handle swap server unreachable
note: testnet swap server is offline atm
closes https://github.com/spesmilo/electrum/issues/8107
2023-01-01 23:43:25 +00:00
Sander van Grieken
c51b6dd75a qml: server list styling, group indicator per chain 2022-12-31 12:52:10 +01:00
Sander van Grieken
f774174c85 qml: add serverlistmodel.py, add server list to ServerConfigDialog.qml 2022-12-30 23:46:04 +01:00
Sander van Grieken
f13b43d546 qml: styling server/proxy config 2022-12-30 22:46:52 +01:00
Sander van Grieken
e6e3fd7083 qml: move label outside of server/proxy config component 2022-12-30 22:40:14 +01:00
Sander van Grieken
90d64a004b qml: make dialog content flickable for small displays for CloseChannelDialog, OpemChannelDialog and InvoiceDialog 2022-12-28 16:07:30 +01:00
Sander van Grieken
87aa44eb26 qml: show swap service problem to user 2022-12-28 14:59:39 +01:00
Sander van Grieken
d80e9e7dea qml: don't crash when initiating swap when swap service is not available 2022-12-27 17:41:58 +01:00
SomberNight
61f2654f31 wallet: fire fewer 'status' and 'wallet_updated' triggers
Especially during initial history sync, there are a lot of False->False up_to_date transitions
(e.g. adb.add_address generates one), and the GUI does some work for each, which adds up to a lot
of CPU usage for the full sync.
2022-12-23 09:35:29 +00:00
SomberNight
0037053d73 bitcoin: 3x speedup for DecodeBase58Check
(compared to HEAD~2)

rewrite base_{decode,encode} based on 2fae7065e3/base58/__init__.py
2022-12-23 09:14:18 +00:00
SomberNight
4f20e4a21f bitcoin: trivial speedup for DecodeBase58Check (down to ~80% time) 2022-12-23 09:14:14 +00:00
SomberNight
29a0560f98 rework AddressSynchronizer.is_up_to_date
- AddressSynchronizer no longer has its own state re up_to_date,
  it defers to Synchronizer/Verifier instead
- Synchronizer is now tracking address sync states throughout their lifecycle:
  and Synchronizer.is_up_to_date() checks all states
- Synchronizer.add_queue (internal) is removed as it was redundant
- should fix wallet.is_up_to_date flickering during sync due to race

related:
dc6c481406
1c20a29a22
2022-12-21 15:23:11 +00:00
ghost43
77981956d6 Merge pull request #7953 from SomberNight/202208_logging_stderr_timestamps
logging: add a relative timestamp to stderr console logs
2022-12-21 15:07:47 +00:00
SomberNight
1c20a29a22 Revert "wallet.is_up_to_date: fix flickering during sync due to race"
This reverts commit dc6c481406 as it introduced its own issue:
while add_address was running on one thread, synchronizer._reset could be running on another,
and by the time the "enqueue" coro would run, it would use a new add_queue and
addr would not be in requested_addrs anymore...

```
I/w | wallet.Standard_Wallet.[test_segwit_2] | starting taskgroup.
I | lnworker.LNWallet.[test_segwit_2] | starting taskgroup.
E/i | interface.[testnet.qtornado.com:51002] | Exception in run: KeyError('tb1q3wmgf8n5eettnj50pzgnfrrpdpjmwn37x7nzsc5780kk4je9v4hspym8mu')
Traceback (most recent call last):
  File ".../electrum/electrum/util.py", line 1243, in wrapper
    return await func(*args, **kwargs)
  File ".../electrum/electrum/interface.py", line 506, in wrapper_func
    return await func(self, *args, **kwargs)
  File ".../electrum/electrum/interface.py", line 529, in run
    await self.open_session(ssl_context)
  File ".../electrum/electrum/interface.py", line 679, in open_session
    async with self.taskgroup as group:
  File ".../aiorpcX/aiorpcx/curio.py", line 304, in __aexit__
    await self.join()
  File ".../electrum/electrum/util.py", line 1339, in join
    task.result()
  File ".../electrum/electrum/synchronizer.py", line 80, in _run_tasks
    async with taskgroup as group:
  File ".../aiorpcX/aiorpcx/curio.py", line 304, in __aexit__
    await self.join()
  File ".../electrum/electrum/util.py", line 1339, in join
    task.result()
  File ".../electrum/electrum/synchronizer.py", line 127, in subscribe_to_address
    self.requested_addrs.remove(addr)
KeyError: 'tb1q3wmgf8n5eettnj50pzgnfrrpdpjmwn37x7nzsc5780kk4je9v4hspym8mu'
```
2022-12-20 16:15:24 +00:00
SomberNight
dc6c481406 wallet.is_up_to_date: fix flickering during sync due to race
AddressSynchronizer.add_address called synchronizer.add, which would only
schedule adding the addr to the Synchronizer in the next event loop iter.
If during that time, the synchronizer called adb.set_up_to_date(True),
the wallet would falsely believe and advertise itself as up_to_date
(as the wallet would see wallet.synchronize not creating new addresses,
and adb (via synchronizer) telling it is up_to_date).
Moments later, the synchronizer._add_address is finally executed and
up_to_date=False propagates out synchronizer->adb->wallet.
2022-12-20 13:58:02 +00:00
SomberNight
d821e26f6e hw DeviceMgr: speed-up client_for_keystore() for common-case
This method is often called when there is already an existing paired
client for the keystore, in which case we can avoid scan_devices() -
which would needlessly take several seconds.
2022-12-19 13:10:24 +00:00
SomberNight
a4276102f2 hw DeviceMgr: don't filter already paired devices in wizard
Related to prev commit: multiple (compatible) keystores can now match
with the same HardwareClientBase, so we might as well also allow
reusing existing Clients for the wizard.
2022-12-19 13:10:20 +00:00
SomberNight
cea4238b81 hw DeviceMgr: mostly switch away from xpubs for device pairing
- the DeviceMgr no longer uses xpubs to keep track of paired hw devices
- instead, introduce keystore.pairing_code(), based on soft_device_id
- xpubs are now only used in a single place when the actual pairing happens
- motivation is to allow pairing a single device with multiple generic
  output script descriptors, not just a single account-level xpub
- as a side-effect, we now allow pairing a device with multiple open
  windows simultaneously (if keystores have the same root fingerprint
  -- was already the case before if keystores had the same xpub)
2022-12-19 08:19:19 +00:00
SomberNight
8878059b2f hw bitbox02: show error if trying to sign_message on testnet
User was getting confusing traceback.
Original discussion shows the device only supports messages for mainnet.

see https://github.com/spesmilo/electrum/pull/6649#issuecomment-708634831
2022-12-19 07:49:40 +00:00
ThomasV
a383f56909 Simplify RBF user experience:
- replace complex strategies with a simpler choice,
   between preserving or decreasing the payment.
 - Always expose that choice to the user.
 - Show the resulting fees to the user before they click OK
2022-12-13 11:26:44 +01:00
SomberNight
4d3f50e80d hw DeviceMgr: simplify pairing management
No semantic/functional changes.
2022-12-12 11:33:13 +00:00
ThomasV
fe62534a66 fix rbf parameter in paytomany API (follow-up e1dc7d1e6f) 2022-12-11 07:35:17 +01:00
ThomasV
49984b2ed4 fix tests (follow-up e1dc7d1e6f) 2022-12-11 07:24:28 +01:00
ThomasV
e1dc7d1e6f Set the RBF flat to all transactions, and remove the 'use_rbf'
preference from the GUI, because the mempoolfullrbf option in
Bitcoin 0.24 makes RBF signaling pretty meaningless. Fixes #8088.

Note: RBF remains disabled for channel funding transactions.
In that case, the flag is actually only used as a semaphore
between different instances of the same wallet.
2022-12-10 18:58:15 +01:00
SomberNight
8995a3e1bd Qt chan list: Ctrl+F filter to work for long channel id 2022-12-10 12:46:17 +00:00
SomberNight
52ccea5329 lnchannel: log chan id in ChannelBackup logger
otherwise it's hard to debug what's going on when having many channels
2022-12-10 12:45:53 +00:00
ThomasV
e8ac09721c kivy: remove user_rbf boolean property (unused) 2022-12-07 15:59:11 +01:00
ThomasV
3131fde97b submarine swaps: set rbf for CLI transactions
(it was already the case with GUI)
2022-12-07 13:26:29 +01:00
SomberNight
f86229f169 Merge pull request #8091 from zouppen/convert_currency_cmd
Add command for currency conversions
2022-12-06 18:29:49 +00:00
Joel Lehtonen OH64K
a24a928e9f commands: Make conversion to/from BTC the default
As suggested by SomberNight in PR #8091, the difference is that this
commit handles currencies in case-insensitive manner.

Co-authored-by: ghost43 <somber.night@protonmail.com>
2022-12-06 16:46:15 +02:00
Joel Lehtonen
62711a57bc commands: Better default currencies in convert_currency
Co-authored-by: ghost43 <somber.night@protonmail.com>
2022-12-06 04:19:48 +02:00
Joel Lehtonen
0b540956fb exchange_rate: "BTC" to "BTC" rate is not guaranteed to be present
Which ccy rates are available depends on the configured
exchange (config key use_exchange) and the configured currency (config
key currency). Only for some exchanges, the fx.ccy-BTC fx rate is
available (depends on the ExchangeBase.get_rates implementation).

As they say, for hodlers 1 BTC = 1 BTC.
2022-12-06 04:19:23 +02:00
Joel Lehtonen
09170bdd1f commands: Improve error messages in convert_currency
Co-authored-by: ghost43 <somber.night@protonmail.com>
2022-12-06 03:30:24 +02:00
Joel Lehtonen OH64K
cdc1660d47 commands: Remove unused requested_amount and fix a typo (#8090) 2022-12-05 22:31:16 +00:00
Joel Lehtonen
02dba54ab9 commands: Add command "convert_currency"
This adds command "convert_currency" which allows the user to do
currency conversions via command line or JSON RPC. Wallet not
required.
2022-12-05 23:29:37 +02:00
Joel Lehtonen
01d31dd61d exchange_rate: Add precisions of some cryptocurrencies
There are many cryptocurrencies available in CoinGecko and some other
exchange rate providers. If the user wants to use a cryptocurrency as
a display currency, the precisions used to be 2. This patch adds
precisions of some cryptocurrencies.
2022-12-05 23:08:12 +02:00
Joel Lehtonen
9ac58d0bc0 exchange_rate: Allow formatting amount with custom currency 2022-12-05 23:08:12 +02:00
Sander van Grieken
21d1842b84 log if get_history fails sanity check 2022-12-03 11:09:51 +01:00
Sander van Grieken
96f4530eb2 qml: ReceiveDialog styling 2022-12-05 19:42:29 +01:00
ghost43
e8c5ff5d2d Merge pull request #8087 from SomberNight/20221204_build_nproc_2
CI: AppImage build is failing with `Container errored with 'OOMKilled'`
2022-12-04 16:30:37 +00:00
SomberNight
feb75ec9e6 CI: AppImage build is failing with "Container errored with 'OOMKilled'"
"AppImage build" on the CI is failing with "Container errored with 'OOMKilled'" since 65ae281180
https://cirrus-ci.com/task/6506466559918080
https://cirrus-ci.com/task/6518283422662656

Apparently, when running in a Cirrus CI container, `nproc` returns the number of host CPUs,
instead of the number of cpus available to the container.
Opened upstream issue:
https://github.com/cirruslabs/cirrus-ci-docs/issues/1115
2022-12-04 00:11:29 +00:00
SomberNight
8cfbce827c ledger plugin: fix binaries
follow-up https://github.com/spesmilo/electrum/pull/8041
(ac239a81b8)
2022-12-03 22:52:23 +00:00
SomberNight
65ae281180 build: don't hardcode num worker threads "make -j4" 2022-12-03 22:50:18 +00:00
Sander van Grieken
96af21faeb qml: show extra fee in ConfirmTxDialog (2fa) 2022-12-02 13:50:31 +01:00
Sander van Grieken
ad2b01716c qml: request details hooks to backend callback, not to QEWallet signal.
Also fix destructor issue
2022-12-01 11:39:28 +01:00
Sander van Grieken
4c7ab67474 qml: receive dialog flickable when challenged vertical space 2022-12-01 10:33:16 +01:00
Sander van Grieken
5e34f01f53 qml: keep elements in place when QR code (and size) changes in ReceiveDialog 2022-12-01 10:00:26 +01:00
Sander van Grieken
ffcd533a8d qml: refactor OpenChannel to dialog, fix lifecycle/race conditions swap & openchannel 2022-11-30 15:10:35 +01:00
Sander van Grieken
56e37f74d4 qml: swapdialog styling fixes 2022-11-30 14:20:29 +01:00