public class VersionTally extends 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.
|
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 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()
Copyright © 2016. All rights reserved.