Commit graph

12 commits

Author SHA1 Message Date
Gustavo Stingelin
df7dfba12a
staticaddr/loopin: preserve loop-in last update time 2026-07-21 11:33:46 -03:00
Slyghtning
491fddbc34
loopdb: persist static loop-in risk decisions
Add schema, sqlc queries, store fields, and SqlStore support for
recording server confirmation-risk decisions with static loop-in swaps.
Store the decision timestamp so payment-deadline recovery can
reconstruct elapsed time after restart.
2026-07-12 09:14:33 +02:00
Slyghtning
508bf90a1c
staticaddr/loopin: preserve selected deposit outpoints
Store an independent snapshot of the outpoints selected for a
static loop-in.

Recovered swaps remain tied to the original funding outputs even if
deposit records later change confirmation or replacement metadata.

Avoid decoding an empty database outpoint string as a synthetic
outpoint.
2026-07-08 09:00:34 +02:00
Slyghtning
f982ceb753 staticaddr/loopin: include failed swaps in state queries
The final-state query previously formatted the state list with braces, which broke the comma-delimited match for both boundary entries: the first state was compared with a leading brace and the last state with a trailing brace. Final-state callers need swaps at both ends of the list, including HtlcTimeoutSwept and Failed, to remain visible once they reach a terminal status.

Return the final-state list as plain comma-separated state names, update the store comment to match the query format, and extend the store test so it inserts and retrieves swaps in the first final state, a middle final state, and the last final state without relying on result order.
2026-06-22 10:18:07 +02:00
Boris Nagaev
7cf0a87c2b
liquidity: count static loop-ins
Teach the liquidity manager to include persisted static loop-ins
in budget accounting, in-flight limits, and peer traffic backoff.
This adds the static fee model used for conservative accounting
and passes storage errors through the relevant planner helpers.

The daemon wiring now exposes static loop-ins to liquidity so the
manager can see the same ongoing swaps that the static-address
subsystem persists, while easy autoloop keeps working with the new
fallible traffic lookup path.
2026-05-22 02:20:36 -05:00
Boris Nagaev
25056c6547
staticaddr: remove redundant pgx.ErrNoRows checks
pgx/v5 defines ErrNoRows as a wrapped sql.ErrNoRows, so this code covers both
of them: errors.Is(err, sql.ErrNoRows).
2026-03-04 18:33:40 -05:00
Slyghtning
51258af025
staticaddr: fast-flag support
--fast allows the client to expedite the publishing
of on-chain swap transactions with change, e.g. if --amount was specified.
2025-10-07 08:53:39 +02: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
fe7622db87
staticaddr: fetch deposits as part of swap retrieval
since deposits have been normalized in the db in the
context of a static address swap this commit now
retrieves the deposit information as part of
GetLoopInByHash and GetStaticAddressLoopInSwapsByStates.
2025-08-01 11:26:33 +02:00
Slyghtning
6e7441ba8d
staticaddr: migrate swap hashes to deposits 2025-08-01 11:26:32 +02:00
sputn1ck
409b2e9929
staticaddr/sql_store: Add fetching loop in by hash 2024-12-12 18:31:09 +01:00
Slyghtning
e7c3717886
staticaddr: sql_store 2024-12-12 18:31:07 +01:00