Commit graph

33 commits

Author SHA1 Message Date
Slyghtning
a10c741a26
lint: fix linter issues 2026-03-09 14:39:45 +01:00
Slyghtning
0b295123e7
staticaddr: remove dead code across managers
Remove unused errChan fields from the loopin, openchannel, and withdraw
managers. These channels were declared and initialized but never read
from or written to.

Remove the unused activeLoopIns map from the loopin manager. The map
was only written to but never read, making it dead code.

Remove the stale withdraw.Store interface whose method signatures no
longer match the concrete SqlStore API used by the manager.

Remove unused config fields from openchannel.Config (Server,
AddressManager, ChainNotifier, Signer) and deposit.ManagerConfig
(AddressClient, SwapClient, ChainParams) along with their daemon
wiring. Also remove the now-orphaned openchannel.AddressManager
interface.

Remove the unused GetStaticAddress and Close methods from
address.SqlStore and the GetStaticAddress method from the address.Store
interface, as the codebase only uses GetAllStaticAddresses.
2026-03-09 14:39:44 +01:00
Slyghtning
a9977dd5f4
godoc: address copy-paste errors accross the codebase 2026-03-09 14:39:44 +01:00
Slyghtning
c1036ff705
withdraw: handle confirmation registration failures 2026-03-09 14:39:44 +01:00
Slyghtning
d39e247a74
withdraw: use %v instead of %w in log.Errorf
The %w formatting verb is only meaningful for fmt.Errorf where it
enables error wrapping. In log.Errorf it prints as %%!w(error=...),
producing garbled log output. Use %v and add the missing colon
separator.
2026-03-09 08:37:50 +01:00
Slyghtning
33891ae6ae
withdraw: check error from RegisterSpendNtfn before using channels
handleWithdrawal did not check the error returned by
RegisterSpendNtfn before spawning a goroutine to read from the
notification channels. If registration failed, spentChan would be nil
and the goroutine would block forever on a nil channel read.

Add the missing error check so the function returns early on
registration failure.
2026-03-09 08:37:50 +01:00
Slyghtning
dfc75f2e1a
staticaddr: open channel manager 2026-02-26 20:57:26 +01:00
Slyghtning
880694c8df
staticaddr: harden and test signMusig2Tx 2025-12-09 12:21:51 +01:00
Slyghtning
078399da80
staticaddr: replace ServerWithdrawDeposits rpc /w ServerPsbtWithdrawDeposits 2025-12-09 12:21:51 +01:00
Boris Nagaev
6d480cfd9e
staticaddr: require positive heights at startup
Loop now guards all static-address managers against zero block heights: each
constructor returns an error when invoked with a non-positive current height,
and `loopd` validates the height from `GetInfo` before instantiating them.
Tests and helper code were updated accordingly so we fail fast instead of
registering chain notifications with invalid hints.
2025-11-16 01:24:01 -03:00
Boris Nagaev
deced54665
staticaddr/withdraw: make error log unique
Make it easier to distinguish this error from a similar error few lines above.
2025-11-16 00:26:02 -03:00
Slyghtning
d0670f109b
staticaddr: add nil checks for withdrawals 2025-09-15 13:53:30 +02:00
Slyghtning
0ee9a617e6
staticaddr: log errors in manager.Run 2025-08-26 09:47:18 +02:00
Slyghtning
1930be8cc7
staticaddr: round up withdrawal tx weight to the nearest satoshi
this commit fixes issue
https://github.com/lightninglabs/loop/issues/966
2025-08-21 09:34:15 +02:00
Slyghtning
412fe7ffd9
staticaddr: simplify withdrawal fsm transition
previously upon recovery, a withdrawing deposit was
first transitioned into the Deposited state by the
deposit manager, and then again into the Withdrawing
state by the withdrawal manager. The first transition
is unnecessary, so we just remain in the Withdrawing
state upon recovery.
2025-07-02 15:42:12 +02:00
Boris Nagaev
61542197f6
staticaddr: use tx hash not *wire.MsgTx as a key
Do not rely on GetActiveDepositsInState reusing the same *wire.MsgTx
pointer for a unique transaction.
2025-06-24 01:44:32 -03:00
Boris Nagaev
38aaa4d07a
staticaddr: recover withdrawals in parallel
Use errgroup to publish each transaction in a separate goroutine.
Publishing a transaction can take a while in neutrino mode.
2025-06-24 01:44:32 -03:00
Boris Nagaev
3ed8c7a9fc
staticaddr/withdraw: log PublishTransaction start 2025-06-24 01:44:32 -03:00
Slyghtning
13247c4651
staticaddr: wait for address manager initiation 2025-06-13 15:37:38 +02:00
Slyghtning
5718f11162
staticaddr: store historic withdrawal info 2025-06-10 17:07:30 +02:00
Slyghtning
b780a9ae91
staticaddr: simplify handleWithdrawal 2025-05-28 11:58:02 +02:00
Boris Nagaev
4e4390416b
staticaddr: fix logs, use %v not %w in logs 2025-05-13 11:49:50 -03:00
Slyghtning
b5af507c6b
staticaddr: don't ignore output-already-spent publish error 2025-04-28 19:43:29 +02:00
Slyghtning
82e34a6d5e
staticaddr: allow rbf'ing withdrawal transactions 2025-04-28 19:43:28 +02:00
Boris Nagaev
6d3f65a0f2
looprpc: rename field in WithdrawDepositsResponse
It returns an address, but the field was called pk_script, which was confusing.
Also renamed it in the code.
2025-04-24 11:19:59 -03:00
Boris Nagaev
dc4a5641ac
multi: initialize block height in New, not in Run
If Run sets the current height field, it is technically a race between Run and
other methods reading the field. Setting in New is a safer option.

Removed a check that height is not 0 from static address manager.
2025-03-19 15:00:31 +01:00
Boris Nagaev
4c292f179f
staticaddr: fix race conditions in current height
Make the current height an atomic variable in staticaddr/address/manager.go and
in staticaddr/withdraw/manager.go.
Removed the initiation height from staticaddr/deposit/manager.go (not needed).
2025-03-19 15:00:30 +01:00
Oliver Gugger
65251e8821
multi: update linter, fix issues 2025-03-10 22:59:50 +01:00
Slyghtning
c1c809d729
staticaddr: re-add feeRate to withdrawal request 2025-03-03 16:17:38 +01:00
Slyghtning
2622882d76
staticaddr: arbitrary withdrawal amount 2025-02-09 15:57:24 +01:00
Slyghtning
acea303178
staticaddr: check dust limits before withdrawing 2024-12-16 11:37:48 +01:00
Slyghtning
042b513d50
staticaddr: dest addr and fee rate for withdrawals 2024-12-12 18:31:10 +01:00
Slyghtning
3dca1537c3
staticaddr: withdrawal manager and interface 2024-12-12 18:31:05 +01:00