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

Đang mở
#1,289 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@claravanstaden đang làm issue này rồi.

Từ ngày 12/11/2026.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
593
Fork
139
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lightninglabs/loop

Tất cả issue của lightninglabs/loop

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.