ACINQ / eclair

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

Abort interactive-tx during funding #2769

Closed t-bast closed 1 year ago

t-bast commented 1 year ago

If we abort the interactive-tx protocol while we're waiting for bitcoind to fund the transaction, we must avoid sending an obsolete tx_add_input for the funded transaction. There is a check in Channel.scala to only send an outgoing interactive-tx message if we have an active interactive-tx session, but this isn't sufficient in the following scenario:

In that scenario we would mix tx_add_input from the old and the new interactive-tx session, which leads to a duplicate serial_id.

codecov-commenter commented 1 year ago

Codecov Report

Merging #2769 (24c29d9) into master (9ca9227) will increase coverage by 0.01%. Report is 1 commits behind head on master. The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##           master    #2769      +/-   ##
==========================================
+ Coverage   85.84%   85.85%   +0.01%     
==========================================
  Files         216      216              
  Lines       18102    18095       -7     
  Branches      762      777      +15     
==========================================
- Hits        15540    15536       -4     
+ Misses       2562     2559       -3     
Files Coverage Δ
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 93.39% <100.00%> (-0.03%) :arrow_down:
...inq/eclair/channel/fund/InteractiveTxBuilder.scala 91.54% <100.00%> (+0.04%) :arrow_up:
...cinq/eclair/remote/EclairInternalsSerializer.scala 97.82% <100.00%> (ø)
...scala/fr/acinq/eclair/router/BalanceEstimate.scala 98.93% <100.00%> (ø)
.../src/main/scala/fr/acinq/eclair/router/Graph.scala 97.25% <100.00%> (-0.09%) :arrow_down:
...cala/fr/acinq/eclair/router/RouteCalculation.scala 94.56% <100.00%> (ø)
...src/main/scala/fr/acinq/eclair/router/Router.scala 94.78% <100.00%> (ø)
...main/scala/fr/acinq/eclair/router/Validation.scala 93.75% <100.00%> (-1.25%) :arrow_down:

... and 4 files with indirect coverage changes