ThomasV
fbebe7de1a
Make lnwatcher not async
...
This fixes offline history not having the proper labels
2025-03-14 11:09:11 +01:00
ThomasV
42b072aca8
submarine swaps: formatting
2025-03-14 09:22:32 +01:00
ThomasV
fff90a1426
submarine swaps: check preimage before labeling a refund transaction
2025-03-14 09:13:18 +01:00
ThomasV
ba2e4ff99a
txbatcher: set wanted height for future tx that has unconfirmed parent
...
also, do not unset it in the subsequent if statement
2025-03-14 09:05:21 +01:00
ThomasV
62f5e7f6bd
Merge pull request #9606 from f321x/jit-improve-qml
...
Handle just in time channels in qml request creation
2025-03-14 08:35:37 +01:00
ThomasV
3adfe9a8de
Merge pull request #9598 from f321x/jit-gui-improvements
...
Handle zeroconf lightning requests in QT gui
2025-03-14 08:34:00 +01:00
SomberNight
3ff794da12
wallet: (trivial) refactor is_frozen_coin
2025-03-14 00:07:26 +00:00
SomberNight
80d0d5fddd
qt confirm_tx_dialog: show frozen balance if "not enough funds"
2025-03-13 23:32:19 +00:00
SomberNight
8ccd31fe49
wallet: set_frozen_state_of_coins to handle freeze=None
...
Internally whether a coin is frozen is tri-state:
- forced-True, set by the user
- forced-False, set by the user
- unset/default: is_frozen_coin() can decide whether the coin should be frozen
This patch lets set_frozen_state_of_coins() undo a previous explicit setting of True/False,
by calling it with a value of None.
Note: there is still no way in the GUI to undo an explicit setting of True/False.
2025-03-13 18:32:58 +00:00
ThomasV
9351183876
Merge pull request #9633 from f321x/fix-qml-swap-exception
...
Use FeePolicy in qeswaphelper to fix exception
2025-03-13 18:01:23 +01:00
f321x
601ff7f731
use FeePolicy in qeswaphelper
2025-03-13 17:31:42 +01:00
SomberNight
089568430d
lnchannel: remove threshold from should_be_closed_due_to_expiring_htlcs
...
The threshold was added a long time ago before we considered running electrum as a forwarding node.
(also, 500k sats are now worth 20x more in fiat terms, lol)
Against a forwarding node, it is actually exploitable.
2025-03-13 16:10:51 +00:00
SomberNight
8c320b4b5c
lnchannel: add comment to extract_preimage_from_htlc_txin
...
ref https://github.com/spesmilo/electrum/issues/9631
2025-03-13 16:06:00 +00:00
ThomasV
b64109ea88
swaps: set locktime to None instead of zero, so that anti fee-sniping works
2025-03-13 12:46:13 +01:00
f321x
af8d1fb401
handle jit invoices in qml
...
make min funding amount symbol, change Signal name, change Exception type
change minChannelFunding to QEAmount and make message text variable
qml: improve translatibility of strings
init minchannelfunding value in init method
rebase on master
2025-03-13 12:02:46 +01:00
f321x
5134d07b14
add zeroconf handling to qt gui
2025-03-13 11:49:50 +01:00
f321x
7a6b4adca9
validate zeroconf channel once mined
2025-03-13 10:56:54 +01:00
ThomasV
bdb7a82220
batch payment manager:
...
The class TxBatcher handles the creation, broadcast and replacement
of replaceable transactions. Callers (LNWatcher, SwapManager) use
methods add_payment_output and add_sweep_info. Transactions
created by TxBatcher may combine sweeps and outgoing payments.
Transactions created by TxBatcher will have their fee bumped
automatically (this was only the case for sweeps before).
TxBatcher manages several TxBatches. TxBatches are created
dynamically when needed.
The GUI does not touch txbatcher transactions:
- wallet.get_candidates_for_batching excludes txbatcher
transactions
- RBF dialogs do not work with txbatcher transactions
wallet:
- instead of reading config variables, make_unsigned_transaction
takes new parameters: base_tx, send_change_to_lighting
tests:
- unit tests in test_txbatcher.py (replaces test_sswaps.py)
- force all regtests to use MPP, so that we sweep transactions
with several HTLCs. This forces the payment manager to aggregate
first-stage HTLC tx inputs. second-stage are not batched for now.
2025-03-13 10:17:10 +01:00
ThomasV
e09676b26f
swaps_dialog: fee_slider_callback should be called at the end of constructor
2025-03-13 08:47:30 +01:00
ThomasV
798df671ea
If we have proposed htlcs in a channel that was force-closed,
...
call lnworker.htlc_failed once the htlc_tx is deeply mined.
In the case of a forwarding, this will fail incoming htlcs.
(fixes #8547 )
2025-03-12 20:11:11 +01:00
SomberNight
57452d6cd5
lnutil: rm duplication of htlc witness script templates
2025-03-12 17:17:14 +00:00
ThomasV
77c180f793
lnutil: add htlc witness_script templates for anchors
...
extracted from https://github.com/spesmilo/electrum/pull/9628
2025-03-12 16:41:45 +00:00
ThomasV
9d0cc6c4a3
follow-up c7dcfab
2025-03-11 18:16:41 +01:00
SomberNight
3f327eea07
wallet: fix wallet.make_unsigned_transaction method signature
...
- "fee_policy" arg is actually mandatory
- and fix test/stdio guis following fee_policy/config split
follow-up 840243e029
2025-03-11 16:15:17 +00:00
SomberNight
7343d69ed7
qt/fee_slider: add type hints, small API change, qt parenting
2025-03-11 15:45:26 +00:00
SomberNight
163f59f83f
qt/main_window: fix regression in confirm_tx_dialog
...
follow-up 605b511b43
2025-03-11 15:22:14 +00:00
SomberNight
75d800a4ea
gui: move reused text to messages.py
2025-03-11 15:08:45 +00:00
ThomasV
c7dcfab3fc
lnwatcher: remove unused class ListenerItem
2025-03-11 13:31:49 +01:00
ThomasV
c42201ccac
remove lnworker.enable_htlc_settle_onchain: not used
...
I think this has only been used for manual testing
2025-03-11 12:12:43 +01:00
Sander van Grieken
083b32be3b
qt,qml: more regression fixes
2025-03-10 19:42:37 +01:00
Sander van Grieken
f917234acc
qml: more regression fixes w.r.t 840243e029
2025-03-10 17:38:21 +01:00
Sander van Grieken
a00cf35fd0
qml: fix regression 840243e029
2025-03-10 16:31:28 +01:00
Sander van Grieken
7030f3de18
qml: followup d005da1ea2
2025-03-09 14:55:00 +01:00
Sander van Grieken
6331ac0f85
lnutil: imports, whitespace, remove unused code
2025-03-09 12:30:02 +01:00
SomberNight
a7c634b1ab
regtests: extend "extract_preimage" to cover both types of extracts
2025-03-07 17:06:55 +00:00
ThomasV
764cc78386
Merge pull request #9590 from f321x/jit-update-unfunded-state
...
Handle unfunded zeroconf channels in update_unfunded_state
2025-03-07 13:55:55 +01:00
f321x
6fd833ccfb
add handling of zeroconf channels to update_unfunded_state
2025-03-07 13:53:01 +01:00
ThomasV
8011ae00ab
Merge pull request #9586 from f321x/jit-block-preimage
...
Add mechanism to block htlcs from settling back
2025-03-07 12:04:39 +01:00
f321x
109ad2b3da
add mechanism to block htlcs from settling back
2025-03-07 12:03:59 +01:00
ThomasV
4641c913c7
lnwatcher: remove unneeded for ... else construct
...
(backport from batch_payment_manager branch)
2025-03-07 10:44:58 +01:00
ghost43
32b0e62cdc
Merge pull request #9608 from SomberNight/202503_asyncio_gc
...
asyncio: hold our own strong refs for tasks and futures
2025-03-06 16:07:55 +00:00
ThomasV
d5ee678b7f
if a network object is there but fee estimates are not available,
...
raise NoDynamicFeeEstimates in FeePolicy rather than in wallet.
Also, show an error message in Qt
2025-03-06 13:13:01 +01:00
Sander van Grieken
7d8a5cc259
qml: improve QEAmount comments, convert to docstring.
2025-03-06 10:56:28 +01:00
ThomasV
074ede8f12
make_unsigned_transaction: pass merge_duplicate_outputs as
...
a parameter, because it must not be used in some contexts
(e.g. tx batcher).
This makes config.MERGE_DUPLICATE_OUTPUTS a GUI option
2025-03-06 09:22:12 +01:00
SomberNight
0b3a283586
asyncio: hold our own strong refs for tasks and futures
...
see https://docs.python.org/3.13/library/asyncio-task.html#asyncio.create_task :
> Important
>
> Save a reference to the result of this function, to avoid a task
> disappearing mid-execution. The event loop only keeps weak references
> to tasks. A task that isn’t referenced elsewhere may get garbage
> collected at any time, even before it’s done. For reliable
> “fire-and-forget” background tasks, gather them in a collection
ref https://github.com/python/cpython/issues/91887
ref https://github.com/beeware/toga/pull/2814
2025-03-05 17:06:04 +00:00
SomberNight
b88d9f9d06
network: follow-up ProxySettings. make sure probe_tor cleans-up.
...
follow-up 2aa427b4bf
2025-03-05 17:04:49 +00:00
ThomasV
943f6436c7
make_unsigned_transaction: make some parameters non-optional
2025-03-05 16:10:27 +01:00
SomberNight
2aa427b4bf
Merge branch 'pr/9507': qt: refactor NetworkChoiceLayout to ProxyWidget+ServerWidget
...
ref https://github.com/spesmilo/electrum/pull/9507
2025-03-05 15:01:05 +00:00
SomberNight
5dc2ae243e
util: refactor Tor-detection to be async
...
- on my PC, with Tor Browser running (socks proxy on port 9150), detect_tor_socks_proxy took ~4.01 seconds
- this was because we probed port 9050, 2 sec timeout, 9051, 2 sec timeout, 9150, ~few ms to succeed
- instead we now probe all ports concurrently
2025-03-05 14:46:47 +00:00
ThomasV
ab14c3e138
tx batching in GUI:
...
- discard config.WALLET_BATCH_RBF
- allow the user to choose base_tx from a list of batching
candidates in ConfirmTxDialog
2025-03-05 14:07:02 +01:00