Show / Hide Table of Contents

Struct BlockPerception

An implementation of IBlockExcerpt with a timestamp attached.

Used for keeping track of when the local node has percieved IBlockExcerpts.

Implements
IBlockExcerpt
Namespace: Libplanet.Blocks
Assembly: Libplanet.dll
Syntax
public readonly struct BlockPerception : IBlockExcerpt

Constructors

| Improve this Doc View Source

BlockPerception(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.

| Improve this Doc View Source

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 blockExcerpt.

Properties

| Improve this Doc View Source

Hash

A block's hash.

Declaration
public readonly BlockHash Hash { get; }
Property Value
Type Description
BlockHash
See Also
PreEvaluationHash
StateRootHash
Hash
| Improve this Doc View Source

Index

A block's index (height).

Declaration
public readonly long Index { get; }
Property Value
Type Description
Int64
See Also
Index
| Improve this Doc View Source

PerceivedTime

The time in UTC when the local node perceived the corresponding IBlockExcerpt.

Declaration
public readonly DateTimeOffset PerceivedTime { get; }
Property Value
Type Description
DateTimeOffset
| Improve this Doc View Source

ProtocolVersion

A block's protocol version.

Declaration
public readonly int ProtocolVersion { get; }
Property Value
Type Description
Int32
See Also
ProtocolVersion
| Improve this Doc View Source

TotalDifficulty

The sum of a block and its all ancestors' difficulties.

Declaration
public readonly BigInteger TotalDifficulty { get; }
Property Value
Type Description
BigInteger
See Also
TotalDifficulty

Methods

| Improve this Doc View Source

ToString()

Declaration
public override readonly string ToString()
Returns
Type Description
String

Implements

IBlockExcerpt
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2021 Planetarium