diff --git a/eclair-core/src/test/scala/fr/acinq/eclair/integration/basic/channel/GossipIntegrationSpec.scala b/eclair-core/src/test/scala/fr/acinq/eclair/integration/basic/channel/GossipIntegrationSpec.scala index 32b19ea443..7498d871aa 100644 --- a/eclair-core/src/test/scala/fr/acinq/eclair/integration/basic/channel/GossipIntegrationSpec.scala +++ b/eclair-core/src/test/scala/fr/acinq/eclair/integration/basic/channel/GossipIntegrationSpec.scala @@ -84,8 +84,15 @@ class GossipIntegrationSpec extends FixtureSpec with IntegrationPatience { // Alice creates a channel_announcement for the splice transaction and updates the graph. val spliceAnn = inside(getRouterData(alice)) { routerData => - assert(routerData.channels.keys == Set(splice_scid_ab, scid_bc)) - assert(routerData.spentChannels.isEmpty) + routerData.spentChannels match { + case spentChannels if spentChannels.isEmpty => + assert(routerData.channels.keys == Set(splice_scid_ab, scid_bc)) + case spentChannels => + // Handle the special case where Alice receives ExternalChannelSpent after validating the local channel update + // for the splice and treating it as a new channel; the original splice will be removed when the splice tx confirms. + assert(spentChannels.contains(spliceTxId) && spentChannels(spliceTxId) == Set(scid_ab)) + assert(routerData.channels.keys == Set(splice_scid_ab, scid_bc, scid_ab)) + } val channel_ab = routerData.channels(splice_scid_ab) assert(channel_ab.capacity == 200_000.sat) assert(channel_ab.update_1_opt.nonEmpty && channel_ab.update_2_opt.nonEmpty)