ACINQ / eclair

A scala implementation of the Lightning Network.
Apache License 2.0
1.24k stars 266 forks source link

Skip anchor tx when remote commit has been evicted #2830

Closed t-bast closed 8 months ago

t-bast commented 8 months ago

When we detect that the remote commit has been published, we spend our anchor output from that commit if the fees are too low and we have funds at risk. But if the remote commit is then evicted from our mempool, we cannot publish our anchor tx and must instead skip it, since we don't provide the fully signed remote commitment to the publisher.

We otherwise error when calling fundrawtransaction, where bitcoind fails because it cannot find the external non-wallet utxo. This change gets rid of those errors that can be quite confusing for node operators.

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e32044f) 85.94% compared to head (95136b0) 85.94%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2830 +/- ## ========================================== - Coverage 85.94% 85.94% -0.01% ========================================== Files 219 219 Lines 18429 18435 +6 Branches 770 773 +3 ========================================== + Hits 15839 15844 +5 - Misses 2590 2591 +1 ``` | [Files](https://app.codecov.io/gh/ACINQ/eclair/pull/2830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ) | Coverage Δ | | |---|---|---| | [...ir/channel/publish/ReplaceableTxPrePublisher.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2830?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL2NoYW5uZWwvcHVibGlzaC9SZXBsYWNlYWJsZVR4UHJlUHVibGlzaGVyLnNjYWxh) | `68.37% <100.00%> (+1.70%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/ACINQ/eclair/pull/2830/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ)