mirror of
https://github.com/monero-project/monero.git
synced 2025-07-28 01:25:29 -04:00
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
This commit is contained in:
parent
d0d76f771a
commit
8330e772f1
30 changed files with 731 additions and 195 deletions
|
@ -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<crypto::hash> m_hashes;
|
||||
std::vector<uint64_t> m_weights;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue