diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-30 16:31:19 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-01-30 16:32:14 +0000 |
commit | 1c9d5285d11e41508731b51fcd3a7d8c6db65cfd (patch) | |
tree | d24aa7c9d51d6c0faae4f5b1f0b44971f1930ccf /src/blockchain_utilities/blockchain_prune.cpp | |
parent | Merge pull request #4988 (diff) | |
download | monero-1c9d5285d11e41508731b51fcd3a7d8c6db65cfd.tar.xz |
blockchain_prune: don't prune before v10
This uses system time since it doesn't see the p2p network,
so is not 100% accurate
Diffstat (limited to 'src/blockchain_utilities/blockchain_prune.cpp')
-rw-r--r-- | src/blockchain_utilities/blockchain_prune.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/blockchain_utilities/blockchain_prune.cpp b/src/blockchain_utilities/blockchain_prune.cpp index 8e13f2c04..36080aade 100644 --- a/src/blockchain_utilities/blockchain_prune.cpp +++ b/src/blockchain_utilities/blockchain_prune.cpp @@ -611,6 +611,24 @@ int main(int argc, char* argv[]) } already_pruned = true; } + if (n == 0) + { + const uint64_t blockchain_height = core_storage[0]->get_current_blockchain_height(); + const crypto::hash hash = core_storage[0]->get_block_id_by_height(blockchain_height - 1); + cryptonote::block block; + if (core_storage[0]->get_block_by_hash(hash, block)) + { + if (block.major_version < 10) + { + time_t now = time(NULL); + if (now < 1555286400) // 15 april 2019 + { + MERROR("Pruning before v10 will confuse peers. Wait for v10 first"); + return 1; + } + } + } + } } core_storage[0]->deinit(); core_storage[0].reset(NULL); |