New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostRestartHtlcCleaner handle channel closing #1338
Commits on Mar 31, 2020
-
Add missing cases to PostRestart
When a channel is closed we want to remove its HTLCs from our list of pending broken HTLCs (they are being resolved on-chain). We should also ignore outgoing HTLCs that have already been settled upstream (which can happen when downstream is closing).
Configuration menu - View commit details
-
Copy full SHA for 0a9d2bb - Browse repository at this point
Copy the full SHA 0a9d2bbView commit details -
Watch for downstream HTLC resolved on-chain
When a downstream channel is closing, we can safely fail upstream the HTLCs that were either timed out on-chain or not included in the broadcast commit transaction. Channels will not always raise events about those after a reboot, so we need to inspect the channel state and detect such HTLCs.
Configuration menu - View commit details
-
Copy full SHA for 0547cde - Browse repository at this point
Copy the full SHA 0547cdeView commit details -
Add helper function to HTLC scripts
To extract the payment_hash or preimage from an HTLC script seen on-chain.
Configuration menu - View commit details
-
Copy full SHA for 6d8d2be - Browse repository at this point
Copy the full SHA 6d8d2beView commit details -
Cleanup on-chain HTLC timeout handling for MPP
With MPP, it's possible that a channel contains multiple HTLCs for the same payment hash, and potentially even for the same expiry and amount. We add more fine-grained handling of HTLC timeouts that share the same payment hash. This allows a cleaner handling after a restart, and makes sure we correctly detect failure that should be propagated upstream. Otherwise we wouldn't be losing any money, but some channels may be closed that we can avoid.
Configuration menu - View commit details
-
Copy full SHA for 6edcf34 - Browse repository at this point
Copy the full SHA 6edcf34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6267a8d - Browse repository at this point
Copy the full SHA 6267a8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0791853 - Browse repository at this point
Copy the full SHA 0791853View commit details
Commits on Apr 1, 2020
-
A couple refactorings to avoid duplication and some clean-up.
Configuration menu - View commit details
-
Copy full SHA for b9590b1 - Browse repository at this point
Copy the full SHA b9590b1View commit details -
Handle out-of-order htlc-timeout txs
It may happen that a commit tx and some htlc-timeout txs end up in the same block. In that case, there is no guarantee on the order we'll receive the confirmation events. If any tx in a local/remoteCommitPublished is confirmed, that implicitly means that the commit tx is confirmed (because it spends from it). So we can consider the closing type known and forward the failure upstream.
Configuration menu - View commit details
-
Copy full SHA for 79f8d37 - Browse repository at this point
Copy the full SHA 79f8d37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 30e4f97 - Browse repository at this point
Copy the full SHA 30e4f97View commit details