Bitcoin Lightning developers patch LND bug that could drop settled payment records after restart
Lightning developers fix bug that could erase settled payment records
Developers behind LND, a widely used implementation of Bitcoin's Lightning Network, have patched a software flaw that could cause a node to lose track of settled payments after it restarts. The Lightning Network lets users send Bitcoin through payment channels without recording every transaction directly on the blockchain.
The bug came from an error in how the software saved and restored channel updates. It could make a node rebuild incomplete payment records when restarting, even though the original information was still stored on its disk. That threatened the accuracy of the records participants use to know which payments have settled and what each party is owed.
Key details of the flaw and the fix
- Developers released two patched versions, v0.21.8-beta and v0.20.8-beta, on Nov. 11.
- The problem involved a counter that tracked acknowledged updates from a connected Lightning peer.
- The counter was stored as a 16-bit unsigned integer, which can hold values only up to 65,535.
- When the list reached 65,536 entries, the counter reset to zero, even though LND kept writing the updates to storage.
- After a restart, the node could read that zero as an empty list and leave out a previously settled HTLC — a conditional payment mechanism that helps secure transactions across Lightning channels.
- The fix rejects oversized lists before advancing the local commitment tail, before returning a revocation, and before writing bytes to storage.
- For older records with a wrapped count, the updated database reader can recover a complete trailing list after checking its entries and count. Malformed trailing data is rejected.
What the LND maintainer and release notes say
According to LND maintainer Olaoluwa Osuntokun, known as Roasbeef, the old unsigned acknowledged remote update list stored its count as a 16-bit unsigned integer. At 65,536 entries the count wrapped to zero even though every entry had been written. Under that overflow condition, a restart could load an empty update list and omit a previously settled HTLC from the reconstructed commitment state, per his pull-request explanation on GitHub.
The release notes for both v0.21.8-beta and v0.20.8-beta include a fix that rejects oversized unsigned acknowledged update logs and validates records when they are loaded. This prevents a restart from silently dropping previously acknowledged channel updates.
Peers may have been able to push the list toward its limit
The flaw became more concerning after developers identified a potential way for connected peers to push the affected update list toward its limit. In the GitHub discussion on the pull request, LND collaborator ziggie1984 explained how this could happen. The supplied material does not include the full details of that explanation.
What is confirmed and what is still unknown
Confirmed from the sources: the bug existed in LND's handling of acknowledged update records, patches were released on Nov. 11 in v0.21.8-beta and v0.20.8-beta, and the fix blocks new oversized logs while conditionally recovering complete older records.
It remains unknown whether any live nodes actually encountered the bug before the patch. The reviewed sources do not establish any observed exploitation or financial loss.
Why accurate channel records matter
Lightning channel participants rely on accurate records to determine which payments have settled and what each party is owed. A bug that lets a node drop a settled HTLC from its reconstructed state could disrupt that accounting, which is why developers moved to patch it.