Added missing integrity check

This commit is contained in:
SChernykh 2021-08-24 13:33:55 +02:00
parent 15354e5a88
commit 4837b4c863

View file

@ -197,9 +197,10 @@ void BlockCache::load_all(SideChain& side_chain, P2PServer& server)
continue;
}
block.deserialize(data + sizeof(uint32_t), n, side_chain);
server.add_cached_block(block);
++blocks_loaded;
if (block.deserialize(data + sizeof(uint32_t), n, side_chain) == 0) {
server.add_cached_block(block);
++blocks_loaded;
}
}
LOGINFO(1, "loaded " << blocks_loaded << " cached blocks");