protocol: add checks for top block hard fork version

We won't even talk to a peer which claims a wrong version
for its top block. This will avoid syncing to known bad
peers in the first place.
Also add IP fails when failing to verify a block.
This commit is contained in:
moneromooo-monero 2017-08-09 09:31:00 +01:00
parent 7482253a6d
commit 635929eaca
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 22 additions and 0 deletions

View file

@ -745,6 +745,15 @@ namespace cryptonote
*/
uint8_t get_ideal_hard_fork_version(uint64_t height) const { return m_hardfork->get_ideal_version(height); }
/**
* @brief returns the actual hardfork version for a given block height
*
* @param height the height for which to check version info
*
* @return the version
*/
uint8_t get_hard_fork_version(uint64_t height) const { return m_hardfork->get(height); }
/**
* @brief get information about hardfork voting for a version
*