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