@@ -122,12 +122,16 @@ abstract class ChannelNormal(bag: ChannelBag) extends Channel {
122122
123123 case (null , init : INPUT_INIT_FUNDEE , - 1 ) =>
124124 val ChannelKeys (_, _, fundingKey, revocationKey, _, delayedPaymentKey, htlcKey) = init.localParams.keys
125- val emptyUpfrontShutdown : TlvStream [AcceptChannelTlv ] = TlvStream (ChannelTlv UpfrontShutdownScript ByteVector .empty)
125+ // Echo back the funder's channel type (BOLT 2: fundee MUST set channel_type to the same value
126+ // as in open_channel, so the funder's validateParamsFunder check doesn't reject our accept_channel).
127+ val acceptTlvRecords = Seq [AcceptChannelTlv ](ChannelTlv .UpfrontShutdownScript (ByteVector .empty)) ++
128+ init.channelFeatures.channelType_opt.map(ChannelTlv .ChannelTypeTlv ).toSeq
129+ val acceptTlvStream : TlvStream [AcceptChannelTlv ] = TlvStream (acceptTlvRecords : _* )
126130
127131 val accept = AcceptChannel (init.theirOpen.temporaryChannelId, init.localParams.dustLimit, init.localParams.maxHtlcValueInFlightMsat, init.localParams.channelReserve,
128132 init.localParams.htlcMinimum, minimumDepth = LNParams .minDepthBlocks, init.localParams.toSelfDelay, init.localParams.maxAcceptedHtlcs, fundingPubkey = fundingKey.publicKey,
129133 revocationBasepoint = revocationKey.publicKey, paymentBasepoint = init.localParams.walletStaticPaymentBasepoint, delayedPaymentBasepoint = delayedPaymentKey.publicKey,
130- htlcBasepoint = htlcKey.publicKey, init.localParams.keys.commitmentPoint(index = 0L ), emptyUpfrontShutdown )
134+ htlcBasepoint = htlcKey.publicKey, init.localParams.keys.commitmentPoint(index = 0L ), acceptTlvStream )
131135
132136 val data1 = DATA_WAIT_FOR_FUNDING_CREATED (init, RemoteParams (init.theirOpen.dustLimitSatoshis, init.theirOpen.maxHtlcValueInFlightMsat, init.theirOpen.channelReserveSatoshis,
133137 init.theirOpen.htlcMinimumMsat, init.theirOpen.toSelfDelay, init.theirOpen.maxAcceptedHtlcs, init.theirOpen.fundingPubkey, init.theirOpen.revocationBasepoint,
0 commit comments