1
0
Commit Graph

17284 Commits

Author SHA1 Message Date
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
ThomasV
b563c9dd0e submarine swaps: do not set attempts parameter in pay_invoice
there is no reason to handle that differently.
2024-01-18 12:38:10 +01:00
accumulator
3b841a8dcd Merge pull request #8761 from accumulator/minsdk_23
qml: android.minapi and android.ndk_api to 23 (android 6.0+)
2024-01-18 01:00:15 +01:00
Sander van Grieken
55a2005a6b qml: update history view after address/key delete. fixes #8782 2024-01-18 00:28:02 +01:00
SomberNight
ef9ba0985e wallet: (trivial) add asserts re args in bump_fee and friends
for clearer exceptions in case of bugs

related https://github.com/spesmilo/electrum/issues/8571
2024-01-17 20:37:31 +00:00
SomberNight
c178be74b7 storage: replace assert in append() with named exception
for nicer bug reports

related https://github.com/spesmilo/electrum/issues/8664
2024-01-17 20:20:24 +00:00
SomberNight
49c3567d7d wallet: simplify bump_fee: rm txid arg
closes https://github.com/spesmilo/electrum/issues/8797
2024-01-17 19:20:29 +00:00
SomberNight
de2007e90c adb: simplify get_conflicting_transactions 2024-01-17 18:58:18 +00:00
SomberNight
76e547a084 followup: call super().__init__() for WalletFileException descendants
cases missed in 57bd291491
2024-01-17 14:42:19 +00:00
SomberNight
4a82072443 qt: new_channel_dialog: init USE_RECOVERABLE_CHANNELS cb intuitively
if `not lnworker.can_have_recoverable_channels()`,
- previously: the cb was disabled and checked
- now: the cb is disabled and unchecked
2024-01-17 14:13:20 +00:00
Sander van Grieken
e2bb7df54a qml: invert, more strict check in determine_can_pay for invoice types,
also disable paste button while PI is being evaluated
2024-01-17 14:09:57 +01:00
Sander van Grieken
4469e9989d qml: LNURLp has no bolt11 to query until later. fixes #8822 2024-01-17 13:52:01 +01:00
SomberNight
bbd3bd2ffe wallet.is_lightning_funding_tx: also check channel_backups 2024-01-17 12:24:09 +00:00
ghost43
0470d345ed Merge pull request #8818 from SomberNight/202401_ci_cron
ci: only run build tasks once per day (or on manual trigger)
2024-01-17 03:19:37 +00:00
SomberNight
248e50eed0 transaction: rename tx.is_final to tx.is_rbf_enabled, and invert it 2024-01-17 02:08:15 +00:00
SomberNight
f30d81a98f swapserver plugin: fix doc 2024-01-17 01:15:14 +00:00
ghost43
52c4acb483 Merge pull request #8814 from SomberNight/202401_lnpeer_chan_reest
lnpeer.reestablish_channel: fix some timing issues for dataloss case
2024-01-16 17:33:27 +00:00
SomberNight
d63253b30b ci: only run build tasks once per day (or on manual trigger)
related https://github.com/cirruslabs/cirrus-ci-docs/discussions/949
2024-01-16 17:28:08 +00:00
SomberNight
0e5a1380ca i18n: simplify language default. only translate string if using GUI. 2024-01-16 17:23:43 +00:00
SomberNight
83c47439cd fix tests
follow-up d8f579ccfc

TODO tests assume locale is English
2024-01-16 16:53:35 +00:00
Sander van Grieken
6a28ef5db3 qt: add ElectrumWindow.set_payment_identifier delegate 2024-01-16 17:40:50 +01:00
SomberNight
7de45c1325 ci: pin flake8 version
- new version of flake8-bugbear (24.1.16) introduced new tests (B036), which we were failing
- that's fine, but our CI should not suddenly break because of this
- better to do explicit manual version bumps of the linter
2024-01-16 16:31:56 +00:00
Sander van Grieken
d8f579ccfc Consistently use translated strings for UserFacingException raises 2024-01-16 16:25:33 +01:00
Sander van Grieken
291f0ce235 qml: handle exception more gracefully when attempting to delete last address from imported wallet 2024-01-16 15:56:49 +01:00
Sander van Grieken
4a4497b5e9 qt: wizard: styling, add icons to success/error messages 2024-01-16 12:44:00 +01:00
Sander van Grieken
3d9996ab8b trustedcoin: disable OTP entry after successful validation 2024-01-16 12:30:24 +01:00
Sander van Grieken
82c21bc30d wizard: take hardware_device from correct location for cosigners. fixes #8808 2024-01-16 11:45:20 +01:00
Sander van Grieken
2b3d7096c6 qt: add typing to ResizableStackedWidget, add index validation to setCurrentIndex,
return None for currentWidget() if current_index == -1
2024-01-16 11:13:57 +01:00
Sander van Grieken
d19dd817d3 followup dab768b932 2024-01-16 10:27:40 +01:00
SomberNight
d4f31929af qt chan details dlg: add onchain feerate, to_self_delay 2024-01-16 04:07:48 +00:00
SomberNight
2696e357c3 lnpeer: add comment to on_channel_reestablish re blocking
In particular, lnd sends both chan_reest and then an error ("sync error").
It is critical we process the chan_reest and transition to WE_ARE_TOXIC before
processing the error (which would trigger us to force-close).

see spec 8a64c6a1ce/02-peer-protocol.md (L1504-L1506) :

> - upon reconnection:
>     [...]
>     - MUST transmit channel_reestablish for each channel.
>     - MUST wait to receive the other node's channel_reestablish message before sending any other messages for that channel.
2024-01-15 21:23:53 +00:00
SomberNight
f808ec911a lnpeer.reest_chan: allow state transition WE_ARE_TOXIC->WE_ARE_TOXIC
if the remote does not know we are behind, they will try to send us chan_reest

```
 38.52 | W | P/lnpeer.Peer.[LNWallet, 034cd7a09f-ed50cf95] | channel_reestablish (533x1x1): remote is ahead of us! They should force-close. Remote PCP: 03857eabd943eec820d56b94d2f162763294565627cc42c4a0db0e7c6b77da46be
 38.52 | E | P/lnpeer.Peer.[LNWallet, 034cd7a09f-ed50cf95] | Exception in main_loop: Exception('Transition not allowed: WE_ARE_TOXIC -> WE_ARE_TOXIC')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1148, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 426, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 440, in main_loop
    async with self.taskgroup as group:
  File "/home/user/.local/lib/python3.10/site-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/home/user/wspace/electrum/electrum/util.py", line 1319, in join
    task.result()
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 1231, in on_channel_reestablish
    chan.set_state(ChannelState.WE_ARE_TOXIC)
  File "/home/user/wspace/electrum/electrum/lnchannel.py", line 215, in set_state
    raise Exception(f"Transition not allowed: {old_state.name} -> {state.name}")
Exception: Transition not allowed: WE_ARE_TOXIC -> WE_ARE_TOXIC
```
2024-01-15 21:21:29 +00:00
SomberNight
df58dd1f25 lnchannel.get_close_opts: allow REQUEST_REMOTE_FCLOSE if WE_ARE_TOXIC
related https://github.com/spesmilo/electrum/issues/8770
2024-01-15 20:13:38 +00:00
SomberNight
140d2d0247 lnpeer: fix timing issues in reestablish_channel, for dataloss case
Assume Alice and Bob have a channel, and Alice is on an old state,
but neither of them knows the latter yet.
Timing scenarios:
1. Alice sends reest first, and Bob receives it before sending reest himself
  - old code: Bob realises Alice is behind, Bob will force-close,
              Bob won't send reest to Alice, so Alice does not learn she is behind
  - new code: Bob realises Alice is behind, Bob will force-close,
              Bob will still send reest to Alice, so Alice learns she is behind.
2. Bob sends reest first, and Alice receives it before sending reest herself
  - old code: Alice learns she is behind. Alice won't send reest to Bob,
              so Bob does not learn he is ahead, so Bob won't force-close.
  - new code: Alice learns she is behind. Alice will still send reest to Bob
              though with ctn=0 instead of actual. Bob learns he is ahead, so
              Bob will force close.
3. Alice and Bob both send reest, and then they both receive what the other sent
  - no change: Alice and Bob both learn Alice is behind. Bob will force-close.
2024-01-15 20:13:34 +00:00
SomberNight
95c55c542e lnworker.suggest_splits: (fix) don't force splitting
lnworker.suggest_splits for non-trampoline case tries to split amts over 5000 sat
but mpp_split.suggest_splits does not return splits where any part is smaller than 10000 sat.
So in practice, without trampoline, invoices between 5k and ~20k sats could not be paid.
This suggests that the logic should not be scattered in multiple places but merged into mpp_split.py...
This commit just does a quick fix though, to try again without splitting if there was no solution.
2024-01-15 20:12:16 +00:00
SomberNight
129917c463 lnworker: fix current_feerate_per_kw for regtest
follow-up 45b248fdef

```
121.72 | I | P/lnpeer.Peer.[LNWallet, 034cd7a09f-e1e44142] | FEES HAVE FALLEN
121.72 | I | P/lnpeer.Peer.[LNWallet, 034cd7a09f-e1e44142] | (chan: 502x1x1) current pending feerate 45000. new feerate 250
121.72 | E | W/lnwatcher.LNWalletWatcher.[default_wallet-LNW] | Exception in update_channel_state: Exception('Cannot update_fee: feerate lower than min relay fee. 250 sat/kw. us: True')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1148, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/lnwatcher.py", line 434, in update_channel_state
    await self.lnworker.handle_onchain_state(chan)
  File "/home/user/wspace/electrum/electrum/lnworker.py", line 1216, in handle_onchain_state
    peer.maybe_update_fee(chan)
  File "/home/user/wspace/electrum/electrum/lnpeer.py", line 2221, in maybe_update_fee
    chan.update_fee(feerate_per_kw, True)
  File "/home/user/wspace/electrum/electrum/lnchannel.py", line 1490, in update_fee
    raise Exception(f"Cannot update_fee: feerate lower than min relay fee. {feerate} sat/kw. us: {from_us}")
Exception: Cannot update_fee: feerate lower than min relay fee. 250 sat/kw. us: True
```
2024-01-15 19:28:55 +00:00
Sander van Grieken
ec81f00896 trustedcoin: cannot reset OTP when seed is not available (online wallet creation continuation) 2024-01-15 17:45:29 +01:00
Sander van Grieken
57bd291491 call super().__init__() for WalletFileException descendants,
qt: handle unfinished wallets when opened via File>Open (ref #8809)
2024-01-15 17:06:44 +01:00
SomberNight
d660c57808 qt BalanceToolButton: rm hardcoded min size
"18 pixels" is too large when using qdarkstyle on "low" DPI screens, on Windows
(if there is also a high DPI screen connected as another monitor... eh)
2024-01-15 15:08:59 +00:00
SomberNight
66b24411e0 qt BalanceToolButton: better sizing on high DPI screens
specifically, on Windows, with display scaling > 100%, the pie btn was too small (not scaled)
2024-01-15 14:41:00 +00:00