ThomasV
9afd2fa098
Merge pull request #9911 from f321x/fix_swap_exception_send_change_to_lightning
...
fix: exceptions when sending change to lightning
2025-06-05 09:15:21 +02:00
Sander van Grieken
044ea1f4f6
submarine_swaps: imports, whitespace
2025-06-04 19:47:30 +02:00
f321x
5ad1b4b5dd
fix: exceptions with send change to lightning
2025-06-04 17:40:04 +02:00
SomberNight
468f496f34
submarine_swaps: make swaps dict thread-safe
...
In general many methods of the SwapManager are called both from the asyncio thread
and from the GUI, and hence must be thread-safe.
closes https://github.com/spesmilo/electrum/issues/9887
2025-06-02 17:06:08 +00:00
SomberNight
4539269960
submarine_swaps.py: trivial clean-up, add some type hints
2025-06-02 16:29:29 +00:00
ThomasV
43ca469774
Merge pull request #9555 from tianzedavid/master
...
chore: fix some typos
2025-05-30 14:36:12 +02:00
ThomasV
f842ce0737
submarine_swaps: consider is_redeemed as sufficient for swap not
...
to be pending
2025-05-27 10:15:27 +02:00
ThomasV
58480a69db
TxBatcher: store fee policy names instead of fee descriptors
...
This allows to change the fee policy of batches dynamically.
Config.fee_policy is a mapping between policy names and descriptors.
2025-05-26 13:30:25 +02:00
f321x
3693c38e37
swaps: replace offers dict with class, fix incorrect naming
...
introduces a class SwapOffer which is used instead of passing around
offers in dicts.
Also fixes incorrect variable naming of swapserver npubs / public keys
by assigning the npub instead of the hex pubkey to
config.SWAPSERVER_NPUB
2025-05-19 14:22:23 +02:00
f321x
07a40b1c53
Improve accuracy of swapserver liquidity announcement.
...
Adds event handler and more calls to the liquidity update trigger to
ensure that changes in liquidity will get published more reliably.
2025-05-19 09:52:53 +02:00
SomberNight
44f3444795
lnworker: make "preimages" dict private
...
I want to hook into lnworker.save_preimage (not done yet).
Other modules should not put preimages into the dict directly.
2025-05-14 13:23:02 +00:00
ThomasV
6e3f173a71
SweepInfo: define csv_delay as property
2025-05-13 08:50:33 +02:00
ThomasV
db271d9b7d
Fix get_pending_swaps: use both funding and spending tx heights
...
Also, do not show closing warnings if we are offline.
2025-05-08 14:58:13 +02:00
f321x
913f5ec6d8
add option to show warnings on wallet close, add warning for ongoing submarine swap
2025-05-07 17:11:08 +02:00
ThomasV
1c3268c2ff
submarine_swaps: make callback async (follow-up previous commit)
2025-05-06 13:03:38 +02:00
accumulator
80e7dce539
Merge pull request #9736 from f321x/swapserver_show_amounts
...
swaps: show swap limits in SwapDialog
2025-04-28 21:59:33 +02:00
accumulator
a7ce107f01
Merge pull request #9737 from f321x/fix_swap_pay_invoice
...
swaps: don't limit attempts when paying swap invoice
2025-04-28 21:50:23 +02:00
SomberNight
5f83fffd2e
swaps.py: (trivial) fix stale type-hint
2025-04-17 17:13:21 +00:00
f321x
6bdedb3ecd
don't limit attempts when paying swap invoice
2025-04-15 15:53:31 +02:00
f321x
48bf7ee2b5
Show swap limits in SwapDialog
2025-04-15 13:06:57 +02:00
ThomasV
4ecf6acc1c
Merge pull request #9691 from f321x/send_change_to_lightning
...
swaps: improve send change to lightning and swapserver error handling
2025-04-09 13:18:54 +02:00
f321x
c27035219a
Set log level of logger passed to the aionostr.Manager to INFO because the debug log output of Manager is very verbose (showing single websocket messages etc.). This still provides enough useful information for debugging purposes.
2025-04-09 12:26:28 +02:00
ThomasV
fe11fa3f4f
Merge pull request #9716 from f321x/fix_swap_exception
...
swaps: make swap transport use shared timeout value
2025-04-09 12:06:52 +02:00
SomberNight
4b9d874d13
util: add fn run_sync_function_on_asyncio_thread
...
note: the return value is not propagated out.
It would be trivial to do that for the block=True case - but what about block=False?
2025-04-08 19:53:49 +00:00
f321x
216bfe3b50
fix race condition causing initialize_swap_manager assert to fail by waiting for trigger_pairs_updated_threadsafe to set the is_initialized event before returning if it is not running on the aio loop
2025-04-08 19:00:05 +02:00
f321x
aace9aab91
make swap transport use shared timeout value
2025-04-08 17:44:17 +02:00
ThomasV
282c4561ff
swapsserver fix for legacy clients. (follow-up 6e92a00)
2025-04-05 18:17:06 +02:00
f321x
6e8bdb346a
move onchain balance calculation to wallet.py
2025-04-04 15:08:51 +02:00
f321x
17a9a91e1f
announce actual available liquidity as swap provider
2025-04-04 15:06:50 +02:00
ThomasV
cb75f21f3b
Merge pull request #9640 from f321x/swap_dm_relays
...
swaps: Update submarine swap nostr relays dynamically and remove redundant query
2025-04-03 13:34:54 +02:00
f321x
4490bd3a76
improve send change to lightning and swapserver error handling
2025-04-02 12:58:27 +02:00
ThomasV
6e92a00ec4
Remove zeroconf option for submarine swaps
...
Since we now accept random swap providers, it is unreasonable
to keep that option.
2025-03-21 18:18:27 +01:00
f321x
21e3fd91dd
dynamically update relays and remove redundant nostr query, store last
...
swapserver relays in file
2025-03-21 09:31:50 +01:00
f321x
9c7773c8db
use ephemeral event type for nostr swap request events
2025-03-20 09:43:48 +01:00
ThomasV
1e4728bdf1
Merge pull request #9560 from f321x/nostr_proxy
...
Pass proxy settings to aionostr manager for submarine swaps
2025-03-19 14:26:27 +01:00
ThomasV
26910ef81d
Merge pull request #9620 from accumulator/lightning_pass_invoice_not_bolt11
...
refactor lnworker.pay_invoice to accept Invoice object instead of bolt11 string
2025-03-18 20:09:01 +01:00
ThomasV
3463e68306
add accounting addresses
2025-03-17 10:47:19 +01:00
SomberNight
977d8b1dd6
wallet: kill create_transaction
2025-03-14 17:19:41 +00:00
SomberNight
3c3778db9c
wallet: towards killing create_transaction: rm "sign" arg
2025-03-14 16:44:46 +00:00
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
b64109ea88
swaps: set locktime to None instead of zero, so that anti fee-sniping works
2025-03-13 12:46:13 +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
SomberNight
57452d6cd5
lnutil: rm duplication of htlc witness script templates
2025-03-12 17:17:14 +00:00
f321x
2290650faa
pass proxy settings to aionostr Manager
...
rebase on master
2025-03-10 10:57:30 +01:00
Sander van Grieken
6fdb6c93f7
refactor lnworker.pay_invoice to accept Invoice object instead of bolt11 string
...
rename lnworker._check_invoice to lnworker._check_bolt11_invoice
2025-03-09 14:47:34 +01:00
ThomasV
840243e029
separate fee policy from config
...
- Wallet.make_unsigned_transaction takes a FeePolicy parameter
- fee sliders act on a FeePolicy instead of config
- different fee policies may be used for different purposes
- do not detect dust outputs in lnsweep, delegate that to lnwatcher
2025-03-05 10:29:26 +01:00
ThomasV
0e40be5fb5
swaps: replace request_swap_for_tx with request_swap_for_amount,
...
as this uses less side effects
(change backported from batch_payment_manager)
2025-03-03 14:02:29 +01:00
f321x
6f97b7b5f9
simplify submarine swap onchain fee model to single base fee
2025-02-20 16:51:48 +01:00