Skip to content

Commit b0ece54

Browse files
committed
fixup! Explicit channel type in channel open
1 parent 28618e7 commit b0ece54

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelFeatures.scala

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,6 @@ object ChannelFeatures {
7171
ChannelFeatures(allFeatures: _*)
7272
}
7373

74-
/** Pick the channel features that should be used based on local and remote feature bits. */
75-
def pickChannelFeatures(localFeatures: Features, remoteFeatures: Features): ChannelFeatures = {
76-
// NB: we don't include features that can be safely activated/deactivated without impacting the channel's operation,
77-
// such as option_dataloss_protect or option_shutdown_anysegwit.
78-
val availableFeatures = Set[Feature](
79-
StaticRemoteKey,
80-
Wumbo,
81-
AnchorOutputs,
82-
OptionUpfrontShutdownScript
83-
).filter(f => Features.canUseFeature(localFeatures, remoteFeatures, f))
84-
85-
ChannelFeatures(availableFeatures)
86-
}
87-
8874
}
8975

9076
/** A channel type is a specific set of even feature bits that represent persistent channel features as defined in Bolt 2. */

eclair-core/src/test/scala/fr/acinq/eclair/channel/ChannelTypesSpec.scala

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,6 @@ class ChannelTypesSpec extends TestKitBaseClass with AnyFunSuiteLike with Channe
5454
assert(!anchorOutputsChannel.paysDirectlyToWallet)
5555
}
5656

57-
test("pick channel features based on local and remote features") {
58-
case class TestCase(localFeatures: Features, remoteFeatures: Features, expectedChannelFeatures: ChannelFeatures)
59-
val testCases = Seq(
60-
TestCase(Features.empty, Features.empty, ChannelFeatures()),
61-
TestCase(Features(StaticRemoteKey -> Optional), Features.empty, ChannelFeatures()),
62-
TestCase(Features.empty, Features(StaticRemoteKey -> Optional), ChannelFeatures()),
63-
TestCase(Features.empty, Features(StaticRemoteKey -> Mandatory), ChannelFeatures()),
64-
TestCase(Features(StaticRemoteKey -> Optional, Wumbo -> Mandatory), Features(Wumbo -> Mandatory), ChannelFeatures(Wumbo)),
65-
TestCase(Features(StaticRemoteKey -> Optional), Features(StaticRemoteKey -> Optional), ChannelFeatures(StaticRemoteKey)),
66-
TestCase(Features(StaticRemoteKey -> Optional), Features(StaticRemoteKey -> Mandatory), ChannelFeatures(StaticRemoteKey)),
67-
TestCase(Features(StaticRemoteKey -> Optional, Wumbo -> Optional), Features(StaticRemoteKey -> Mandatory, Wumbo -> Mandatory), ChannelFeatures(StaticRemoteKey, Wumbo)),
68-
TestCase(Features(StaticRemoteKey -> Optional, AnchorOutputs -> Optional), Features(StaticRemoteKey -> Optional), ChannelFeatures(StaticRemoteKey)),
69-
TestCase(Features(StaticRemoteKey -> Mandatory, AnchorOutputs -> Optional), Features(StaticRemoteKey -> Optional, AnchorOutputs -> Optional), ChannelFeatures(StaticRemoteKey, AnchorOutputs)),
70-
TestCase(Features(OptionUpfrontShutdownScript -> Optional), Features.empty, ChannelFeatures()),
71-
TestCase(Features(OptionUpfrontShutdownScript -> Optional), Features(OptionUpfrontShutdownScript -> Optional), ChannelFeatures(OptionUpfrontShutdownScript)),
72-
TestCase(Features(StaticRemoteKey -> Optional, AnchorOutputs -> Optional, OptionUpfrontShutdownScript -> Optional), Features(StaticRemoteKey -> Optional, AnchorOutputs -> Optional, OptionUpfrontShutdownScript -> Optional), ChannelFeatures(StaticRemoteKey, AnchorOutputs, OptionUpfrontShutdownScript)),
73-
)
74-
75-
for (testCase <- testCases) {
76-
assert(ChannelFeatures.pickChannelFeatures(testCase.localFeatures, testCase.remoteFeatures) === testCase.expectedChannelFeatures)
77-
}
78-
}
79-
8057
test("pick channel type based on local and remote features") {
8158
case class TestCase(localFeatures: Features, remoteFeatures: Features, expectedChannelType: ChannelType)
8259
val testCases = Seq(

0 commit comments

Comments
 (0)