Show / Hide Table of Contents

Class BlockCandidateTable<T>

A class which table data structure that stores Block<T>s received from BoundPeer.

Inheritance
Object
BlockCandidateTable<T>
Namespace: Libplanet.Net
Assembly: Libplanet.Net.dll
Syntax
public class BlockCandidateTable<T> : object where T : IAction, new()
Type Parameters
Name Description
T

An IAction type. It should match to Block<T>'s type parameter.

Constructors

| Improve this Doc View Source

BlockCandidateTable()

Declaration
public BlockCandidateTable()

Properties

| Improve this Doc View Source

Count

Declaration
public long Count { get; }
Property Value
Type Description
Int64

Methods

| Improve this Doc View Source

Add(BlockHeader, IEnumerable<Block<T>>)

Adds a Block<T>s to the table.

Declaration
public void Add(BlockHeader blockHeader, IEnumerable<Block<T>> blocks)
Parameters
Type Name Description
BlockHeader blockHeader

This is the header of the BlockChain<T> tip at the time of downloading the blocks.

IEnumerable<Block<T>> blocks

List of downloaded Block<T>.

| Improve this Doc View Source

Any()

Declaration
public bool Any()
Returns
Type Description
Boolean
| Improve this Doc View Source

Cleanup(Func<IBlockExcerpt, Boolean>)

Declaration
public void Cleanup(Func<IBlockExcerpt, bool> predicate)
Parameters
Type Name Description
Func<IBlockExcerpt, Boolean> predicate
| Improve this Doc View Source

GetCurrentRoundCandidate(BlockHeader)

Get the Block<T>s which are in the table.

Declaration
public SortedList<long, Block<T>>? GetCurrentRoundCandidate(BlockHeader thisRoundTip)
Parameters
Type Name Description
BlockHeader thisRoundTip

Canonical BlockChain<T>'s tip of this round.

Returns
Type Description
Nullable<SortedList<Int64, Block<T>>>

Block<T>s by thisRoundTip.

| Improve this Doc View Source

TryRemove(BlockHeader)

Declaration
public bool TryRemove(BlockHeader header)
Parameters
Type Name Description
BlockHeader header
Returns
Type Description
Boolean
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2022 Planetarium