Show / Hide Table of Contents

Class BlockCandidateTable

A class for storing downloaded Blocks as Dictionary<TKey,TValue>. A BlockHeader is used as a key for storing downloading context.

This is designed to be exception free.

Inheritance
Object
BlockCandidateTable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Net
Assembly: Libplanet.Net.dll
Syntax
public class BlockCandidateTable

Constructors

| Improve this Doc View Source

BlockCandidateTable()

A class for storing downloaded Blocks as Dictionary<TKey,TValue>. A BlockHeader is used as a key for storing downloading context.

This is designed to be exception free.

Declaration
public BlockCandidateTable()

Properties

| Improve this Doc View Source

Count

A class for storing downloaded Blocks as Dictionary<TKey,TValue>. A BlockHeader is used as a key for storing downloading context.

This is designed to be exception free.

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

Methods

| Improve this Doc View Source

Add(BlockHeader, Branch)

Adds given branch to the table.

The internal table is only updated if it does not already contain blockHeader as its key.

Declaration
public void Add(BlockHeader blockHeader, Branch branch)
Parameters
Type Name Description
BlockHeader blockHeader

The header of the BlockChain's tip at the time of downloading the blocks.

Branch branch

The list of downloaded Blocks and its BlockCommits.

| Improve this Doc View Source

Cleanup(Func<IBlockExcerpt, Boolean>)

A class for storing downloaded Blocks as Dictionary<TKey,TValue>. A BlockHeader is used as a key for storing downloading context.

This is designed to be exception free.

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 Blocks which are in the table by BlockHeader.

Declaration
public Branch GetCurrentRoundCandidate(BlockHeader thisRoundTip)
Parameters
Type Name Description
BlockHeader thisRoundTip

Canonical BlockChain's tip of this round.

Returns
Type Description
Branch

A List<T> of Blocks with associated BlockCommits by thisRoundTip if found, otherwise null. The result is guaranteed to be non-empty and consecutive sorted by Index.

See Also
Add(BlockHeader, Branch)
| Improve this Doc View Source

TryRemove(BlockHeader)

A class for storing downloaded Blocks as Dictionary<TKey,TValue>. A BlockHeader is used as a key for storing downloading context.

This is designed to be exception free.

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–2023 Planetarium