Skip to content

[bug]: LND fails to sweep expired HTLC #10984

Description

@bufo24

Pre-Submission Checklist

  • I have searched the existing issues and believe this is a new bug.
  • I am not asking a question about how to use lnd, but reporting a bug (otherwise open a discussion).

LND Version

0.21.1-beta

LND Configuration

LND config are Voltage defaults with the needed settings for tapd.

Backend Version

btcd from Voltage, version unsure

Backend Configuration

Managed by Voltage, config unsure

OS/Distribution

Bug Details & Steps to Reproduce

  1. I tried to send a payment to LND
  2. I later found out that the channel was online on 1 side but offline on the other, so the payments got stuck at the last hop.
  3. The channel never came online so I force closed it.
  4. There were 9 pending HTLCs in the channel which moved onchain.
  5. I assume the preimage never got released, so the HTLC belong to my channel partner.
  6. The funds got sweeped by the peer.
  7. My node tries to sweep the HTLCs as well: Failed to sweep input: [txid:output] (HtlcAcceptedSuccessSecondLevel), error: input no longer exists. It didn't got local funds but it only tries to sweep the HTLCs. This keep the channel in a pending close state

Expected Behavior

It should see that the HTLCs didn't belong to the node and just mark the channel as closed.

Debug Information

2026-07-21 12:02:15.006 [WRN] SWPR: Failing record=1: found orphan inputs: 982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:1 (HtlcAcceptedSuccessSecondLevel)
10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:1 (HtlcAcceptedSuccessSecondLevel)
10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:3 (HtlcAcceptedSuccessSecondLevel)
10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:2 (HtlcAcceptedSuccessSecondLevel)
10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:4 (HtlcAcceptedSuccessSecondLevel)
982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:0 (HtlcAcceptedSuccessSecondLevel)
ac1a090ab3bfcef24cae80079b332dacf08413b9f156c8a943e146522eb6e9a5:0 (HtlcAcceptedSuccessSecondLevel)
10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:0 (HtlcAcceptedSuccessSecondLevel)
982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:2 (HtlcAcceptedSuccessSecondLevel)
2026-07-21 12:02:15.007 [INF] SWPR: Tx=70a45f1e3b05a40bebfa50c317d6885cd0b277e40594c2235965a0f510d16893 failed with unexpected error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:1 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:1 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:3 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:2 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:4 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:0 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: ac1a090ab3bfcef24cae80079b332dacf08413b9f156c8a943e146522eb6e9a5:0 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 10f1ac4c546c15d953d295af7f0b08c6a5e2276d92cd2347790f92bbcda946aa:0 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists
2026-07-21 12:02:15.008 [ERR] SWPR: Failed to sweep input: 982a77ad0f5803cf081aad976c8e4cc6219b96692a8ace2c1eb176db771b777a:2 (HtlcAcceptedSuccessSecondLevel), error: input no longer exists

Channel close TX: https://mempool.ainah.nl/nl/tx/72d6f19f075751731ef208c985206f59f762c2a1e77f6947476b06cfe45f1c19

All pending HTLCs were 30k

Environment

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions