| | 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 channel_reestablish message. |
| | 9 | | /// </summary> |
| | 10 | | /// <remarks> |
| | 11 | | /// Initializes a new instance of the ChannelReestablishPayload class. |
| | 12 | | /// </remarks> |
| | 13 | | /// <param name="channelId">The channel ID.</param> |
| 20 | 14 | | public class ChannelReestablishPayload( |
| 20 | 15 | | ChannelId channelId, |
| 20 | 16 | | CompactPubKey myCurrentPerCommitmentPoint, |
| 20 | 17 | | ulong nextCommitmentNumber, |
| 20 | 18 | | ulong nextRevocationNumber, |
| 20 | 19 | | ReadOnlyMemory<byte> yourLastPerCommitmentSecret) : IChannelMessagePayload |
| | 20 | | { |
| | 21 | | /// <summary> |
| | 22 | | /// Gets the channel ID. |
| | 23 | | /// </summary> |
| 36 | 24 | | public ChannelId ChannelId { get; } = channelId; |
| | 25 | |
|
| | 26 | | /// <summary> |
| | 27 | | /// The commitment transaction counter |
| | 28 | | /// </summary> |
| 36 | 29 | | public ulong NextCommitmentNumber { get; } = nextCommitmentNumber; |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// The commitment counter it expects for the next revoke and ack message |
| | 33 | | /// </summary> |
| 36 | 34 | | public ulong NextRevocationNumber { get; } = nextRevocationNumber; |
| | 35 | |
|
| | 36 | | /// <summary> |
| | 37 | | /// The last per commitment secret received |
| | 38 | | /// </summary> |
| 36 | 39 | | public ReadOnlyMemory<byte> YourLastPerCommitmentSecret { get; } = yourLastPerCommitmentSecret; |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// The current per commitment point |
| | 43 | | /// </summary> |
| 36 | 44 | | public CompactPubKey MyCurrentPerCommitmentPoint { get; } = myCurrentPerCommitmentPoint; |
| | 45 | | } |