Skip to content

Commit 26f06c9

Browse files
authored
Gate new splice tlvs on remote support for splicing (#3031)
We do not send splice TLVs to peers that do not advertise splice support to avoid an issue with CLN using the splice TLVs for testing the (experimental) channel upgrade feature.
1 parent 722c9ff commit 26f06c9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/Channel.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,9 +2275,10 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
22752275
}
22762276
case _ => Set.empty
22772277
}
2278-
val lastFundingLockedTlvs: Set[ChannelReestablishTlv] =
2278+
val lastFundingLockedTlvs: Set[ChannelReestablishTlv] = if (d.commitments.params.remoteParams.initFeatures.hasFeature(Features.SplicePrototype)) {
22792279
d.commitments.lastLocalLocked_opt.map(c => ChannelReestablishTlv.MyCurrentFundingLockedTlv(c.fundingTxId)).toSet ++
22802280
d.commitments.lastRemoteLocked_opt.map(c => ChannelReestablishTlv.YourLastFundingLockedTlv(c.fundingTxId)).toSet
2281+
} else Set.empty
22812282

22822283
val channelReestablish = ChannelReestablish(
22832284
channelId = d.channelId,

eclair-core/src/test/scala/fr/acinq/eclair/channel/states/e/OfflineStateSpec.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ class OfflineStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLike with
945945

946946
// Alice will resend her channel_ready on reconnection because the channel hasn't been used for any payment yet (pre-splice behavior).
947947
alice2bob.expectMsgType[ChannelReady]
948+
bob2alice.expectMsgType[ChannelReady]
948949
alice2bob.expectNoMessage(100 millis)
949950

950951
// we update the channel
@@ -1015,6 +1016,8 @@ class OfflineStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLike with
10151016
bob2alice.expectMsgType[ChannelReestablish]
10161017
bob2alice.forward(alice)
10171018
alice2bob.forward(bob)
1019+
bob2alice.expectMsgType[ChannelReady]
1020+
bob2alice.forward(alice)
10181021

10191022
// Alice will NOT resend their channel_ready at reconnection because she has received bob's announcement_signatures (pre-splice behavior).
10201023
alice2bob.expectNoMessage(100 millis)

0 commit comments

Comments
 (0)