245 bool do_check(
uint8_t block_version,
uint8_t voting_version)
const;
261 uint8_t default_threshold_percent;
264 uint64_t original_version_till_height;
266 std::vector<Params> heights;
268 std::deque<uint8_t> versions;
269 unsigned int last_versions[256];
static const uint64_t DEFAULT_WINDOW_SIZE
bool reorganize_from_chain_height(uint64_t height)
uint8_t get_current_version() const
returns the current version
uint8_t get_next_version() const
returns the next version
static const uint8_t DEFAULT_THRESHOLD_PERCENT
static const time_t DEFAULT_FORKED_TIME
bool check(const cryptonote::block &block) const
check whether a new block would be accepted
void init()
initialize the object
HardFork(cryptonote::BlockchainDB &db, uint8_t original_version=1, uint64_t original_version_till_height=DEFAULT_ORIGINAL_VERSION_TILL_HEIGHT, time_t forked_time=DEFAULT_FORKED_TIME, time_t update_time=DEFAULT_UPDATE_TIME, uint64_t window_size=DEFAULT_WINDOW_SIZE, uint8_t default_threshold_percent=DEFAULT_THRESHOLD_PERCENT)
creates a new HardFork object
void on_block_popped(uint64_t new_chain_height)
called when one or more blocks are popped from the blockchain
static const time_t DEFAULT_UPDATE_TIME
Params(uint8_t version, uint64_t height, uint8_t threshold, time_t time)
Holds cryptonote related classes and helpers.
bool add(const cryptonote::block &block, uint64_t height)
add a new block
unsigned __int64 uint64_t
bool check_for_height(const cryptonote::block &block, uint64_t height) const
same as check, but for a particular height, rather than the top
version
Supported socks variants.
uint8_t get_ideal_version() const
returns the latest "ideal" version
bool get_voting_info(uint8_t version, uint32_t &window, uint32_t &votes, uint32_t &threshold, uint64_t &earliest_height, uint8_t &voting) const
returns information about current voting state
uint64_t get_window_size() const
returns the size of the voting window in blocks
The BlockchainDB backing store interface declaration/contract.
uint64_t get_earliest_ideal_height_for_version(uint8_t version) const
returns the earliest block a given version may activate
bool add_fork(uint8_t version, uint64_t height, uint8_t threshold, time_t time)
add a new hardfork height
bool reorganize_from_block_height(uint64_t height)
called when the blockchain is reorganized
static const uint64_t DEFAULT_ORIGINAL_VERSION_TILL_HEIGHT