1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-12 02:08:30 +01:00

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.
This commit is contained in:
Richard Myers 2025-03-10 17:42:05 +01:00 committed by GitHub
parent 722c9ffac4
commit 26f06c955b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -2275,9 +2275,10 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
}
case _ => Set.empty
}
val lastFundingLockedTlvs: Set[ChannelReestablishTlv] =
val lastFundingLockedTlvs: Set[ChannelReestablishTlv] = if (d.commitments.params.remoteParams.initFeatures.hasFeature(Features.SplicePrototype)) {
d.commitments.lastLocalLocked_opt.map(c => ChannelReestablishTlv.MyCurrentFundingLockedTlv(c.fundingTxId)).toSet ++
d.commitments.lastRemoteLocked_opt.map(c => ChannelReestablishTlv.YourLastFundingLockedTlv(c.fundingTxId)).toSet
} else Set.empty
val channelReestablish = ChannelReestablish(
channelId = d.channelId,

View file

@ -945,6 +945,7 @@ class OfflineStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLike with
// Alice will resend her channel_ready on reconnection because the channel hasn't been used for any payment yet (pre-splice behavior).
alice2bob.expectMsgType[ChannelReady]
bob2alice.expectMsgType[ChannelReady]
alice2bob.expectNoMessage(100 millis)
// we update the channel
@ -1015,6 +1016,8 @@ class OfflineStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLike with
bob2alice.expectMsgType[ChannelReestablish]
bob2alice.forward(alice)
alice2bob.forward(bob)
bob2alice.expectMsgType[ChannelReady]
bob2alice.forward(alice)
// Alice will NOT resend their channel_ready at reconnection because she has received bob's announcement_signatures (pre-splice behavior).
alice2bob.expectNoMessage(100 millis)