public class VersionTally
extends java.lang.Object
Constructor and Description |
---|
VersionTally(NetworkParameters params) |
Modifier and Type | Method and Description |
---|---|
void |
add(long version)
Add a new block version to the tally, and return the count for that version
within the window.
|
java.lang.Integer |
getCountAtOrAbove(long version)
Get the count of blocks at or above the given version, within the window.
|
void |
initialize(BlockStore blockStore,
StoredBlock chainHead)
Initialize the version tally from the block store.
|
int |
size()
Get the size of the version window.
|
public VersionTally(NetworkParameters params)
public void add(long version)
version
- the block version to add.public java.lang.Integer getCountAtOrAbove(long version)
version
- the block version to query.public void initialize(BlockStore blockStore, StoredBlock chainHead) throws BlockStoreException
blockStore
- block store to load blocks from.chainHead
- current chain tip.BlockStoreException
public int size()