HashChain

\class HashChain Class stores dynamic info and handles local files of hash chain

Constructors

this
this(HashChainStorage!Block storage)

Ctor initializes database and reads existing data. @param folder_path - path to folder with chain files

Members

Functions

append
void append(Block block)

Adds given block to the end of chain @param block - block to append to chain

findLastBlock
Block findLastBlock()

Method that finds the last block in chain \return last block or null if it haven't found

getLastBlock
const(Block) getLastBlock()

Get last block \return last block in chain

isValidChain
bool isValidChain()

Method that checks validity of chain \return true is chain is valid, false - otherwise

replay
void replay(void delegate(Block) @(safe) action)
Undocumented in source. Be warned that the author may not have intended to support it.
replayFrom
void replayFrom(void delegate(Block) @(safe) action, bool delegate(Block) @(safe) condition)
Undocumented in source. Be warned that the author may not have intended to support it.
storage
HashChainStorage!Block storage()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_last_block
Block _last_block;

Last block in chain

_storage
HashChainStorage!Block _storage;

Handler of chain blocks storage

Meta