1
using System.Numerics;
2

3
namespace Libplanet.Net
4
{
5
    /// <summary>
6
    /// The blockchain state of <see cref="BoundPeer"/>.
7
    /// </summary>
8
    public readonly struct PeerChainState
9
    {
10
        public PeerChainState(BoundPeer peer, long tipIndex, BigInteger totalDifficulty)
11 1
        {
12 1
            Peer = peer;
13 1
            TipIndex = tipIndex;
14 1
            TotalDifficulty = totalDifficulty;
15 1
        }
16

17
        /// <summary>
18
        /// The peer with chain.
19
        /// </summary>
20 0
        public BoundPeer Peer { get; }
21

22
        /// <summary>
23
        /// The blockchain tip of the <see cref="Peer"/>.
24
        /// </summary>
25 0
        public long TipIndex { get; }
26

27
        /// <summary>
28
        /// The total difficulty of the blockchain of the <see cref="Peer"/>.
29
        /// </summary>
30 0
        public BigInteger TotalDifficulty { get; }
31

32
        /// <inheritdoc />
33
        public override string ToString()
34 0
        {
35 0
            return $"{Peer}, {TipIndex}, {TotalDifficulty}";
36 0
        }
37
    }
38
}

Read our documentation on viewing source code .

Loading