Finst

LDK Fixes Crash Bug in Lightning Nodes, But Release Is Still Missing

The patch prevents routing nodes from making payouts after a crash without collecting the incoming funds first. LDK has merged the fix, but has not released it yet.

LDK Fixes Crash Bug in Lightning Nodes, But Release Is Still Missing

Key Takeaways

  • Lightning Development Kit patched a bug that let routing nodes make outgoing payments after a crash without collecting the related incoming funds.
  • The patch has been merged in pull request 5663, but it has not yet been included in a tagged release.
  • For operators, that means a routine update does not guarantee the fix is already there.

Lightning Development Kit (LDK) has patched a bug that let routing nodes make outgoing payments after a crash without collecting the related incoming funds. The patch has already been merged, but it is still not in a tagged release. For Lightning node operators, that means a routine update does not guarantee the fix is already there.

What Could Go Wrong

The bug was in the way LDK stores channel data asynchronously. If a recovery update was already treated as saved while the write action was still running, a crash could cause a node to pay out the outgoing side of a forwarded payment without a valid claim on the incoming funds. Losses only happened if the on-chain claim was also not confirmed in time afterward. According to the technical newsletter about the Lightning Network, one described case also involved the incoming channel already being broken off with a force-close.

LDK is a widely used library for building Bitcoin Lightning apps. That is exactly why this kind of bug matters for parties that run their own routing nodes or build in their own storage code. The problem was not in the payment itself, but in how recovery after a crash was handled.

The Patch in Pull Request 5663

The fix in pull request #5663 keeps the recovery update pending until the write action is fully finished. The merge description says the update stays pending as long as the write action is still running. Because of that, parties using their own storage code will now also need to indicate when a full channel-monitor write action is done.

The timing makes it extra important to check builds. Package versions 0.2.8 and 0.1.14, along with release candidate 0.3.0-rc4, date back to November 11, so they came before the merge. The manifest for LDK Node 0.7.1 also allows compatible versions from the 0.2 series. LDK itself has not yet named a release that already includes the improvement.

Why This Matters for Operators

For European operators of Lightning infrastructure, this mainly shows how important version checks still are for software that routes payments. A patch can already be in the code while a widely used release is still behind. That makes it harder for administrators to rely only on a version number when it comes to maintenance and security.

There is no report that funds were actually lost because of this bug. The merge describes a situation where losses were possible, not a confirmed incident. A separate recovery tool for Core Lightning already exists for payments that get stuck after channel data is lost. The broader discussion about vulnerabilities in Bitcoin software also plays a role here: Bitcoin Core changes policy because of AI risks after it became clear that many nodes are still running unsupported versions.


Disclaimer: This content is for informational purposes only and does not constitute financial, investment, legal, or tax advice. The information provided may be incomplete, inaccurate, or outdated and should not be relied upon as such. Nothing on this website should be considered a recommendation to buy, sell, or hold any cryptocurrency. Investing in crypto-assets involves risk of loss.