mirror of
https://github.com/ACINQ/eclair.git
synced 2025-03-12 10:30:45 +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:
parent
722c9ffac4
commit
26f06c955b
2 changed files with 5 additions and 1 deletions
|
@ -2275,9 +2275,10 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
|
||||||
}
|
}
|
||||||
case _ => Set.empty
|
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.lastLocalLocked_opt.map(c => ChannelReestablishTlv.MyCurrentFundingLockedTlv(c.fundingTxId)).toSet ++
|
||||||
d.commitments.lastRemoteLocked_opt.map(c => ChannelReestablishTlv.YourLastFundingLockedTlv(c.fundingTxId)).toSet
|
d.commitments.lastRemoteLocked_opt.map(c => ChannelReestablishTlv.YourLastFundingLockedTlv(c.fundingTxId)).toSet
|
||||||
|
} else Set.empty
|
||||||
|
|
||||||
val channelReestablish = ChannelReestablish(
|
val channelReestablish = ChannelReestablish(
|
||||||
channelId = d.channelId,
|
channelId = d.channelId,
|
||||||
|
|
|
@ -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).
|
// 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]
|
alice2bob.expectMsgType[ChannelReady]
|
||||||
|
bob2alice.expectMsgType[ChannelReady]
|
||||||
alice2bob.expectNoMessage(100 millis)
|
alice2bob.expectNoMessage(100 millis)
|
||||||
|
|
||||||
// we update the channel
|
// we update the channel
|
||||||
|
@ -1015,6 +1016,8 @@ class OfflineStateSpec extends TestKitBaseClass with FixtureAnyFunSuiteLike with
|
||||||
bob2alice.expectMsgType[ChannelReestablish]
|
bob2alice.expectMsgType[ChannelReestablish]
|
||||||
bob2alice.forward(alice)
|
bob2alice.forward(alice)
|
||||||
alice2bob.forward(bob)
|
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).
|
// Alice will NOT resend their channel_ready at reconnection because she has received bob's announcement_signatures (pre-splice behavior).
|
||||||
alice2bob.expectNoMessage(100 millis)
|
alice2bob.expectNoMessage(100 millis)
|
||||||
|
|
Loading…
Add table
Reference in a new issue