diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-15 14:57:30 -0500 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-15 14:57:30 -0500 |
commit | 99ffc4974062f1a80ab8eb641fe1859d2e2e9e6d (patch) | |
tree | dc30f5342bf4effe76111996ab2151462828b0fe /src/cryptonote_core/blockchain.cpp | |
parent | Merge pull request #1576 (diff) | |
parent | core: check block version for alt chains too (diff) | |
download | monero-99ffc4974062f1a80ab8eb641fe1859d2e2e9e6d.tar.xz |
Merge pull request #1577
feb499aa core: check block version for alt chains too (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 535eb1a2d..47fc26d39 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1261,6 +1261,14 @@ bool Blockchain::handle_alternative_block(const block& b, const crypto::hash& id return false; } + // this is a cheap test + if (!m_hardfork->check_for_height(b, block_height)) + { + LOG_PRINT_L1("Block with id: " << id << std::endl << "has old version for height " << block_height); + bvc.m_verifivation_failed = true; + return false; + } + //block is not related with head of main chain //first of all - look in alternative chains container auto it_prev = m_alternative_chains.find(b.prev_id); |