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.
Inherited Members
Namespace: Libplanet.Net
Assembly: Libplanet.Net.dll
Syntax
public class BlockCandidateTable
Constructors
| Improve this Doc View SourceBlockCandidateTable()
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 SourceCount
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 SourceAdd(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. |
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 |
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
|
See Also
| Improve this Doc View SourceTryRemove(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 |