aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-04 21:24:09 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-04 21:24:09 +0200
commit196022530b76962d9083dd76487a9179245a78bc (patch)
tree5e380f79c71b05e480639e8eede78b9f4c3e3adc /src/blockchain_utilities
parentMerge pull request #5105 (diff)
parentblockchain_prune: don't prune before v10 (diff)
downloadmonero-196022530b76962d9083dd76487a9179245a78bc.tar.xz
Merge pull request #5108
1c9d5285 blockchain_prune: don't prune before v10 (moneromooo-monero)
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_prune.cpp18
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);