From 8330e772f1ed680a54833d25c4d17d09a99ab8d6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 16 Sep 2019 12:18:34 +0000 Subject: monerod can now sync from pruned blocks If the peer (whether pruned or not itself) supports sending pruned blocks to syncing nodes, the pruned version will be sent along with the hash of the pruned data and the block weight. The original tx hashes can be reconstructed from the pruned txes and theur prunable data hash. Those hashes and the block weights are hashes and checked against the set of precompiled hashes, ensuring the data we received is the original data. It is currently not possible to use this system when not using the set of precompiled hashes, since block weights can not otherwise be checked for validity. This is off by default for now, and is enabled by --sync-pruned-blocks --- src/blockchain_utilities/blocksdat_file.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/blockchain_utilities/blocksdat_file.h') diff --git a/src/blockchain_utilities/blocksdat_file.h b/src/blockchain_utilities/blocksdat_file.h index 315713424..72b7afc17 100644 --- a/src/blockchain_utilities/blocksdat_file.h +++ b/src/blockchain_utilities/blocksdat_file.h @@ -72,10 +72,11 @@ protected: bool open_writer(const boost::filesystem::path& file_path, uint64_t block_stop); bool initialize_file(uint64_t block_stop); bool close(); - void write_block(const crypto::hash &block_hash); + void write_block(const crypto::hash &block_hash, uint64_t weight); private: uint64_t m_cur_height; // tracks current height during export std::vector m_hashes; + std::vector m_weights; }; -- cgit v1.2.3