| | 1 | | using NBitcoin; |
| | 2 | |
|
| | 3 | | namespace NLightning.Domain.Protocol.Payloads; |
| | 4 | |
|
| | 5 | | using Interfaces; |
| | 6 | | using ValueObjects; |
| | 7 | |
|
| | 8 | | /// <summary> |
| | 9 | | /// Represents the payload for the channel_reestablish message. |
| | 10 | | /// </summary> |
| | 11 | | /// <remarks> |
| | 12 | | /// Initializes a new instance of the ChannelReestablishPayload class. |
| | 13 | | /// </remarks> |
| | 14 | | /// <param name="channelId">The channel ID.</param> |
| 20 | 15 | | public class ChannelReestablishPayload(ChannelId channelId, PubKey myCurrentPerCommitmentPoint, |
| 20 | 16 | | ulong nextCommitmentNumber, ulong nextRevocationNumber, |
| 20 | 17 | | ReadOnlyMemory<byte> yourLastPerCommitmentSecret) : IMessagePayload |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Gets the channel ID. |
| | 21 | | /// </summary> |
| 36 | 22 | | public ChannelId ChannelId { get; } = channelId; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// The commitment transaction counter |
| | 26 | | /// </summary> |
| 36 | 27 | | public ulong NextCommitmentNumber { get; } = nextCommitmentNumber; |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// The commitment counter it expects for the next revoke and ack message |
| | 31 | | /// </summary> |
| 36 | 32 | | public ulong NextRevocationNumber { get; } = nextRevocationNumber; |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// The last per commitment secret received |
| | 36 | | /// </summary> |
| 36 | 37 | | public ReadOnlyMemory<byte> YourLastPerCommitmentSecret { get; } = yourLastPerCommitmentSecret; |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// The current per commitment point |
| | 41 | | /// </summary> |
| 36 | 42 | | public PubKey MyCurrentPerCommitmentPoint { get; } = myCurrentPerCommitmentPoint; |
| | 43 | | } |