From 841a4cc618ed922b3d883059eb370fc2c78f0808 Mon Sep 17 00:00:00 2001 From: Javier Smooth Date: Thu, 3 Sep 2015 02:34:43 -0700 Subject: [PATCH] Ignore blockchain file with too-new version --- src/cryptonote_core/blockchain_storage.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cryptonote_core/blockchain_storage.h b/src/cryptonote_core/blockchain_storage.h index 091dcf9..85c24fd 100644 --- a/src/cryptonote_core/blockchain_storage.h +++ b/src/cryptonote_core/blockchain_storage.h @@ -253,6 +253,12 @@ namespace cryptonote template void blockchain_storage::serialize(archive_t & ar, const unsigned int version) { + // * ignore too-new version when reading + if (version > CURRENT_BLOCKCHAIN_STORAGE_ARCHIVE_VER) + { + LOG_PRINT_L0("Saved blockchain version " << version << " is too new, ignoring"); + return; + } if(version < 11) return; CRITICAL_REGION_LOCAL(m_blockchain_lock);