Package com.norswap.nanoeth.blocks
Class Blocks
java.lang.Object
com.norswap.nanoeth.blocks.Blocks
public final class Blocks extends Object
A database that enables retrieving blocks by
hash
.
To retrieve blocks in the canonical chain by number, use Blockchain
instead.
The current implementation is fully in-memory, and does not persist any block to disk.
-
Field Summary
-
Method Summary
-
Field Details
-
DB
Singleton blocks DB instance. TODO: enable running multiple nodes in parallel
-
-
Method Details
-
register
Registers the given block in the block DB. -
get
Returns the block with the given hash, or null if no such block is known. -
getHeader
-
clear
public void clear()Empties the database.
-