| | 1 | | namespace NLightning.Domain.Protocol.Messages; |
| | 2 | |
|
| | 3 | | using Constants; |
| | 4 | | using Models; |
| | 5 | | using Payloads; |
| | 6 | | using Tlv; |
| | 7 | |
|
| | 8 | | /// <summary> |
| | 9 | | /// Represents an open_channel2 message. |
| | 10 | | /// </summary> |
| | 11 | | /// <remarks> |
| | 12 | | /// The open_channel2 message is sent to another peer in order to start the channel negotiation. |
| | 13 | | /// The message type is 64. |
| | 14 | | /// </remarks> |
| | 15 | | public sealed class OpenChannel2Message : BaseMessage |
| | 16 | | { |
| | 17 | | /// <summary> |
| | 18 | | /// The payload of the message. |
| | 19 | | /// </summary> |
| 152 | 20 | | public new OpenChannel2Payload Payload { get => (OpenChannel2Payload)base.Payload; } |
| | 21 | |
|
| 32 | 22 | | public UpfrontShutdownScriptTlv? UpfrontShutdownScriptTlv { get; } |
| 24 | 23 | | public ChannelTypeTlv? ChannelTypeTlv { get; } |
| 20 | 24 | | public RequireConfirmedInputsTlv? RequireConfirmedInputsTlv { get; } |
| | 25 | |
|
| | 26 | | public OpenChannel2Message(OpenChannel2Payload payload, UpfrontShutdownScriptTlv? upfrontShutdownScriptTlv = null, C |
| 16 | 27 | | : base(MessageTypes.OPEN_CHANNEL_2, payload) |
| | 28 | | { |
| 16 | 29 | | UpfrontShutdownScriptTlv = upfrontShutdownScriptTlv; |
| 16 | 30 | | ChannelTypeTlv = channelTypeTlv; |
| 16 | 31 | | RequireConfirmedInputsTlv = requireConfirmedInputsTlv; |
| | 32 | |
|
| 16 | 33 | | if (UpfrontShutdownScriptTlv is not null || ChannelTypeTlv is not null || RequireConfirmedInputsTlv is not null) |
| | 34 | | { |
| 8 | 35 | | Extension = new TlvStream(); |
| 8 | 36 | | Extension.Add(UpfrontShutdownScriptTlv, ChannelTypeTlv, RequireConfirmedInputsTlv); |
| | 37 | | } |
| 16 | 38 | | } |
| | 39 | | } |