Lightning toolkit LDK fixes a bug that could lose forwarded payments after a crash
The fix is in LDK's code but not yet in a release; the newest versions on Rust's package registry date from November 11.

Developers of the Lightning Development Kit (LDK) have fixed a bug that could make a routing node lose a payment after a crash. Bitcoin Optech reported the fix on November 27. The fix is in LDK's main code but not yet in a release. The newest LDK versions on crates.io, Rust's package registry, date from November 11.
Lightning is a payment network that runs on top of Bitcoin. LDK is a toolkit that wallet and app makers use to build Lightning into their own software. A routing node passes payments along: it is paid on an incoming channel and pays out on an outgoing one.
What could go wrong
The bug affected nodes that save channel data in the background, which LDK calls asynchronous persistence. Optech described the case where the peer on the incoming channel force-closes it, settling it on the blockchain.
The node then holds a secret, called the preimage, that lets it claim the incoming payment. Because of an error, LDK did not mark the save of that secret as unfinished. Another save, such as the record of the channel closing, could land on disk sooner. LDK took that as proof the secret was stored too.
The outgoing channel could then drop its own copy. Next, the node might go down before the secret was written, and its claim on the blockchain might not confirm in time. Then it would have paid out on one side and collected nothing on the other, Optech said. LDK now waits for each of these saves to finish before treating it as done. The code change is numbered #5663.
Other fixes the same week
Optech listed more Lightning fixes. A penalty transaction takes back funds when a peer publishes an old, cancelled channel state. When fees stayed high for a long time, LDK could set too low a fee on this penalty. That could let the cheating peer spend funds it had already given up. LDK #5678 now treats it as urgent.
LND, another Lightning implementation, fixed fee estimates for some penalty transactions that could come out too low to be accepted (#11607). It also fixed a bug where a node failed to save a fee change (#11268). That could make it force-close a channel for no reason after a dropped connection.
What operators can check
On November 30, crates.io listed LDK 0.2.8, 0.1.14 and the 0.3.0-rc4 test release as the newest versions, all published November 11. That is before Optech reported the fix. Builders who save LDK data in the background can watch LDK's release notes for a version that includes #5663.
Lightning lets people send small bitcoin payments quickly and cheaply, and routing nodes keep it running. A bug that can make a node pay out without collecting what it is owed puts operators' money at risk. Fixes only protect people once they ship in a release and apps update to it.
Not financial advice. How we report and check stories.
Found this useful? Tip the desk in sats at our Lightning address, tips@orangewirebtc.com. Tips are voluntary. They buy no extra content and no influence over coverage.
Liked this? Get five stories like it every week, plus one chart and one explainer.