loop/staticaddr/loopin
Slyghtning 6582aa0807
staticaddr/loopin: check deposits before htlc signing
Before we send HTLC signatures to the server, the server cannot publish
the HTLC transaction. After those signatures are handed over, the server
can publish an HTLC that spends the selected deposits even if it never
pays the swap invoice.

Defend against stale local deposit state by checking the wallet's current
txout view immediately before signing. A deposit can have been spent by a
known withdrawal, channel open, timeout sweep, replacement, or another
wallet transaction while the loop-in FSM is recovering or while earlier
state still marked it as selected.

Failing before signing leaves the server without spend authority over an
unavailable input. Include mempool spends in the check so wallet-known
unconfirmed spends are treated as unavailable too.
2026-07-08 09:02:06 +02:00
..
actions.go staticaddr/loopin: check deposits before htlc signing 2026-07-08 09:02:06 +02:00
actions_test.go staticaddr/loopin: check deposits before htlc signing 2026-07-08 09:02:06 +02:00
autoloop.go staticaddr: use dp autoloop selector 2026-05-22 02:20:36 -05:00
autoloop_dp.go staticaddr/deposit: guard confirmation height access 2026-07-08 09:01:01 +02:00
autoloop_dp_test.go staticaddr: use dp autoloop selector 2026-05-22 02:20:36 -05:00
autoloop_test.go staticaddr: use dp autoloop selector 2026-05-22 02:20:36 -05:00
deduce_amount_test.go staticaddr: arbitrary loop-in amount 2025-09-25 11:13:34 +02:00
deposit_swaphash_migration.go staticaddr: migrate swap hashes to deposits 2025-08-01 11:26:32 +02:00
deposit_swaphash_migration_test.go staticaddr: selected swap amount migration 2025-09-25 11:13:35 +02:00
fsm.go lint: fix linter issues 2026-03-09 14:39:45 +01:00
interface.go staticaddr/loopin: add lnd txout checker 2026-07-08 09:00:56 +02:00
log.go multi: update lnd compile-time dependency to v0.19.0 2025-03-10 22:59:49 +01:00
loopin.go staticaddr/loopin: use payment timeout duration helper 2026-07-08 09:01:18 +02:00
loopin_test.go staticaddr/loopin: use payment timeout duration helper 2026-07-08 09:01:18 +02:00
manager.go staticaddr/loopin: check deposits before htlc signing 2026-07-08 09:02:06 +02:00
manager_test.go staticaddr/loopin: recover deposits by current outpoint 2026-07-08 09:01:17 +02:00
selected_amount_migration.go staticaddr: selected swap amount migration 2025-09-25 11:13:35 +02:00
selected_amount_migration_test.go staticaddr: selected swap amount migration 2025-09-25 11:13:35 +02:00
sql_store.go staticaddr/loopin: preserve selected deposit outpoints 2026-07-08 09:00:34 +02:00
sql_store_test.go staticaddr/loopin: preserve selected deposit outpoints 2026-07-08 09:00:34 +02:00
txout_checker.go staticaddr/loopin: add lnd txout checker 2026-07-08 09:00:56 +02:00
txout_checker_test.go staticaddr/loopin: add lnd txout checker 2026-07-08 09:00:56 +02:00