staticaddr: a deposit unlocked between the refresh and the lookup can be quoted or selected

Abierto
#1,289 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@claravanstaden ya está trabajando en esto.

Desde el 12/11/2026.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

Start in staticaddr/loopin/manager.go at initiateLoopIn, then trace EnsureDepositsFresh, syncActiveDeposits, and the deposit lookup that follows the refresh. Check how the selected deposits can be validated against the refreshed UTXOs or refreshed after a failed swap returns a deposit to Deposited. Done when a replaced deposit cannot be quoted or selected in that window; the issue mentions an integration test that reproduces the race.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

static-loop-in

EnsureDepositsFresh and the deposit lookup that follows it are two separate steps. syncActiveDeposits only drops deposits that are Deposited and gone from lnd's wallet, so a deposit that is still LoopingIn during the refresh is kept even if its funding tx was replaced. If the swap fails and unlocks that deposit before the lookup, the lookup finds it back in Deposited and uses it.

Seen in an integration test: after a restart, a stored risk rejection failed a swap whose deposit had been replaced by RBF while loopd was offline. A static loop-in quote for that outpoint arrived 5ms before the unlock and was answered. The next refresh drops the deposit.

The same two steps run before a loop-in starts (staticaddr/loopin/manager.go, initiateLoopIn), so manual or automatic selection can also pick the replaced deposit in that window. The server checks that the deposit outpoints are unspent when the swap starts, so the swap is rejected. Funds are not at risk, the user sees one failed swap attempt.

Possible fixes:

  • after the lookup, check the selected deposits against the utxos the refresh just listed;
  • or run the refresh again when a deposit comes back to Deposited after a failed swap.

Low priority.

Lenguaje dominante
Go
Estrellas
593
Forks
139
Merge medio
2 d 8 h
PR fusionados (30 d)
21

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lightninglabs/loop

Todos los issues de lightninglabs/loop

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.