diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-16 12:18:34 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-27 00:10:37 +0000 |
commit | 8330e772f1ed680a54833d25c4d17d09a99ab8d6 (patch) | |
tree | d536126b06a00fabd56881363daaa9a1fd305c80 /src/cryptonote_protocol/cryptonote_protocol_handler.h | |
parent | Merge pull request #5876 (diff) | |
download | monero-8330e772f1ed680a54833d25c4d17d09a99ab8d6.tar.xz |
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
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.h')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h index dcc5ec6ed..2666733da 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.h +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h @@ -137,6 +137,7 @@ namespace cryptonote size_t get_synchronizing_connections_count(); bool on_connection_synchronized(); bool should_download_next_span(cryptonote_connection_context& context, bool standby); + bool should_ask_for_pruned_data(cryptonote_connection_context& context, uint64_t first_block_height, uint64_t nblocks, bool check_block_weights) const; void drop_connection(cryptonote_connection_context &context, bool add_fail, bool flush_all_spans); bool kick_idle_peers(); bool check_standby_peers(); @@ -164,6 +165,7 @@ namespace cryptonote uint64_t m_sync_spans_downloaded, m_sync_old_spans_downloaded, m_sync_bad_spans_downloaded; uint64_t m_sync_download_chain_size, m_sync_download_objects_size; size_t m_block_download_max_size; + bool m_sync_pruned_blocks; boost::mutex m_buffer_mutex; double get_avg_block_size(); |