Struct BlockPerception
An implementation of IBlockExcerpt with a timestamp attached.
Used for keeping track of when the local node has percieved IBlockExcerpts.
Implements
Namespace: Libplanet.Blocks
Assembly: Libplanet.dll
Syntax
public readonly struct BlockPerception : IBlockExcerpt
Constructors
| Improve this Doc View SourceBlockPerception(IBlockExcerpt)
Creates an instance of BlockPerception with the local time in UTC.
Declaration
public BlockPerception(IBlockExcerpt blockExcerpt)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlockExcerpt | blockExcerpt | The excerpt of a block to attach a timestamp to. |
BlockPerception(IBlockExcerpt, DateTimeOffset)
Creates an instance of BlockPerception with a provided timestamp.
Declaration
public BlockPerception(IBlockExcerpt blockExcerpt, DateTimeOffset perceivedTime)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlockExcerpt | blockExcerpt | The excerpt of a block to attach a timestamp to. |
| DateTimeOffset | perceivedTime | The time in UTC when the local node perceived
|
Properties
| Improve this Doc View SourceHash
A block's hash.
Declaration
public readonly BlockHash Hash { get; }
Property Value
| Type | Description |
|---|---|
| BlockHash |
See Also
| Improve this Doc View SourceIndex
A block's index (height).
Declaration
public readonly long Index { get; }
Property Value
| Type | Description |
|---|---|
| Int64 |
See Also
| Improve this Doc View SourcePerceivedTime
The time in UTC when the local node perceived the corresponding IBlockExcerpt.
Declaration
public readonly DateTimeOffset PerceivedTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
ProtocolVersion
A block's protocol version.
Declaration
public readonly int ProtocolVersion { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
See Also
| Improve this Doc View SourceTotalDifficulty
The sum of a block and its all ancestors' difficulties.
Declaration
public readonly BigInteger TotalDifficulty { get; }
Property Value
| Type | Description |
|---|---|
| BigInteger |
See Also
Methods
| Improve this Doc View SourceToString()
Declaration
public override readonly string ToString()
Returns
| Type | Description |
|---|---|
| String |