mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-24 22:58:23 +01:00
When we receive an `UpdateFulfillHtlc` from a downstream channel, it is critical that we don't lose it because that is what allows us to pull funds from the corresponding upstream channel(s). But this(ese) upstream channel(s) may very well be currently OFFLINE and unable to update the commitment right away, so we need to remember it for later. Same applies to an `UpdateFailHtlc` (although it is less critical), because we don't want the upstream htlc to timeout and cause a channel to force-close. We were previously relying on a `CommandBuffer` actor, that uses a "pending relay" database to store commands. Once the command is processed by the target channel, it sends back an acknowledgment to the `CommandBuffer`, which then removes the command from the database. Unacknowledged commands are replayed at each reconnection or app restart. This works well, but the flow is a little cumbersome and not easy to understand. With this PR, the sender (channel, payment handler, ...) is responsible for storing commands to the pending relay db, instead of the command buffer, which is completely removed. The target channel will acknowledge the message and remove it from the pending relay db. In the end, the logic is the same as before, we have just dropped the intermediate `CommandBuffer`. |
||
---|---|---|
.. | ||
src | ||
eclair-cli | ||
pom.xml |