| | | 1 | | namespace NLightning.Domain.Protocol.Payloads; |
| | | 2 | | |
| | | 3 | | using Channels.ValueObjects; |
| | | 4 | | using Crypto.ValueObjects; |
| | | 5 | | using Interfaces; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Represents the payload for the commitment_signed message. |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// Initializes a new instance of the CommitmentSignedPayload class. |
| | | 12 | | /// </remarks> |
| | 8 | 13 | | public class CommitmentSignedPayload( |
| | 8 | 14 | | ChannelId channelId, |
| | 8 | 15 | | IEnumerable<CompactSignature> htlcSignatures, |
| | 8 | 16 | | CompactSignature signature) : IChannelMessagePayload |
| | | 17 | | { |
| | | 18 | | /// <summary> |
| | | 19 | | /// The channel_id this message refers to |
| | | 20 | | /// </summary> |
| | 16 | 21 | | public ChannelId ChannelId { get; } = channelId; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// The signature for the commitment transaction |
| | | 25 | | /// </summary> |
| | 16 | 26 | | public CompactSignature Signature { get; } = signature; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Number of HTLCs outputs |
| | | 30 | | /// </summary> |
| | | 31 | | public ushort NumHtlcs |
| | | 32 | | { |
| | | 33 | | get |
| | | 34 | | { |
| | 8 | 35 | | return (ushort)HtlcSignatures.Count(); |
| | | 36 | | } |
| | | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <summary> |
| | | 40 | | /// List containing HTLCs signatures |
| | | 41 | | /// </summary> |
| | 28 | 42 | | public IEnumerable<CompactSignature> HtlcSignatures { get; set; } = htlcSignatures; |
| | | 43 | | } |