Commit graph

89 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
b74dab8af4
loopd: instantiate static address open channel manager 2026-02-26 20:57:27 +01:00
Boris Nagaev
d1c4a7da8a
loopd: test error reporting logic 2025-12-20 06:31:02 +01:00
Slyghtning
f4e7e676d4
loopd: fix errors.Is argument order 2025-12-19 10:18:09 +01:00
Boris Nagaev
a4dc59099b
cli: add command "loop stop"
* add StopDaemon RPC with permissions + REST binding
* expose `loop stop` CLI (with optional --wait) and wait logic
* pass daemon shutdown callback + unit test and regenerate docs/protos
2025-11-19 23:42:48 -03: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
Andras Banki-Horvath
460fc116d8
loop: add resume manager 2025-10-30 22:41:00 +01:00
Slyghtning
2ee772b251
staticaddr: selected swap amount migration
The selected_amount column of all previous
swaps is filled with the total value of
deposits that partook in these swaps.
2025-09-25 11:13:35 +02:00
Slyghtning
38a44968c7
loopd: atomic var to enforce daemon singelton 2025-08-19 22:08:29 +02:00
Slyghtning
bd6271e633
loopd: log correct error if daemon start fails 2025-08-19 21:57:00 +02:00
Slyghtning
6e7441ba8d
staticaddr: migrate swap hashes to deposits 2025-08-01 11:26:32 +02:00
Boris Nagaev
6f50b27b7d
loopd: increase withdrawal manager start timeout
This is needed for neutrino.
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
614d61937e
loopd: retrieve historic withdrawal info 2025-06-10 17:07:32 +02:00
ffranr
64e6bbd451
perms: move perms.go into looprpc
The Lightning Node Connect (LNC) WASM client currently imports both
`looprpc` and the entire `loop` module to access `perms.go`. This
creates problems because `loop` imports `taproot-assets`, resulting in
too many symbols for the WASM build.

To fix this, we will move `perms.go`—which defines RPC endpoint
permissions—into `looprpc`. After this change, the LNC WASM client will
import only `looprpc`, while the rest of `loop` can continue importing
`taproot-assets` without affecting the LNC WASM build.
2025-04-28 12:56:21 -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
Boris Nagaev
e0e66a9b38
loopd: fix data races of logger 2025-03-19 15:00:30 +01:00
Boris Nagaev
2249c41d2f
loopdb: switch to go.etcd.io/bbolt
github.com/coreos/bbolt has race conditions:
https://github.com/golang/go/issues/54690
2025-03-19 15:00:30 +01:00
sputn1ck
8451f29f8f
loopd: add asset client to swap config 2025-01-21 14:38:02 +01:00
Slyghtning
10b970c5cc
staticaddr: no experimental flag for static 2024-12-13 21:40:42 +01:00
Slyghtning
fc6c9f224c
staticaddr: add initiation height of address 2024-12-12 18:31:10 +01:00
sputn1ck
a98e16184e
loopd/staticaddr: add ntfn manager 2024-12-12 18:31:09 +01:00
Slyghtning
21c37a910a
loopd: static address loop-in support 2024-12-12 18:31:08 +01:00
Slyghtning
a7f2f2d8c8
loopd: static address withdrawals support 2024-12-12 18:31:05 +01:00
Slyghtning
3914ab840f
staticaddr: deposits for server and daemon 2024-12-12 18:31:03 +01:00
Slyghtning
40c731f654
daemon: integrate static address manager and sql store 2024-12-12 18:31:01 +01:00
Slyghtning
22b1f53e3e
daemon: add signet support 2024-11-21 13:47:23 +01:00
sputn1ck
e9f1a1aef3
ntfn: use l402 store for tokens
This commit changes the way we fetch the l402 tokens for the
notification stream. Instead of fetching them from the server and
paying an invoice, we now look into our local store for the token.
This means that a loop client will not autofetch a token.
2024-10-30 17:12:28 +01:00
sputn1ck
f2fb722901
reservation: add initchan
This fixes a flake in the unit tests
2024-10-22 11:46:31 +02:00
sputn1ck
7409ae73c6
loopd: add notification manager
This commit adds the notification manager to the
loopd daemon.
2024-10-08 14:58:41 +02:00
Andras Banki-Horvath
0e2a36004a
loopd: allow setting RPC batch size when running cost migration
Previously we defaulted to fetching 1000 payments at a time when running
the cost migration however due to slowness on LND side this may prevent
the migration from completing due to RPC timeout kicking in. This commit
adds a new config value to give more control to the user by setting the
batch size as needed.
2024-09-20 10:13:48 +02:00
Boris Nagaev
1947b90842
multi: typed callback in ExecTx
Provide a wrapped store type, exposing ExecTx method with a subset
interface in the callback argument. BaseDB interfaces in instantout,
reservation and sweepbatcher use ExecTx with their subset Querier
instead of whole sqlc.Querier (*sqlc.Queries).

This is needed to make the packages more reusable, so they don't
depend on methods of *sqlc.Queries they don't use.
2024-06-19 10:38:55 -03:00
Andras Banki-Horvath
3754730525
loop: paginate fetching payments when running the cost migration 2024-06-05 08:54:24 +02:00
Andras Banki-Horvath
c7fa1e4109
loopd: run the cost migration on start 2024-06-03 14:54:18 +02:00
Slyghtning
636f8b611b
daemon: fix wrapped errors and typos 2024-05-01 07:55:01 +02:00
Boris Nagaev
e30cb5f2a8
multi: apply make fmt 2024-04-23 15:18:15 -03:00
sputn1ck
7cafbe957d
loopd: add instantout handling 2024-02-06 15:07:59 +01:00
George Tsagkarelis
0914074b10
loop: integrate sweepbatcher to loopout flow 2024-01-23 20:38:10 +02:00
sputn1ck
f00329d7c7
loopd: hide reservation manager behind flag. 2024-01-17 15:59:08 +01:00
sputn1ck
49c40d9173
loopd: add reservation handling 2024-01-17 15:59:08 +01:00
Slyghtning
427251d176
loopd: fix error checks and format 2023-11-15 10:51:31 +01:00
Slyghtning
79063d788a
db: refactor db opening 2023-10-13 10:39:17 +02:00
Oliver Gugger
08026dab93
multi: update linter, fix issues 2023-10-03 19:36:40 +02:00
Slyghtning
20316042d9
trivial: clean up typos and comments 2023-08-10 15:43:33 +02:00
sputn1ck
a2abcd07d8
loopd: Run migration if boltdb exists 2023-06-20 18:59:32 +02:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
Slyghtning
043f780198 loopd: adding getInfo rpc call 2023-05-24 17:50:24 +02:00
sputn1ck
ec2ed79f48
loopd: fix macaroons typo
This commit fixes a typo which leads to a broken macaroon store.
2023-03-29 16:19:08 +02:00