aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp6
-rw-r--r--src/blockchain_utilities/blockchain_prune.cpp18
-rw-r--r--src/blockchain_utilities/blockchain_stats.cpp2
3 files changed, 6 insertions, 20 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index 8454595ac..cb9154f29 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -194,7 +194,11 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
core.prevalidate_block_hashes(core.get_blockchain_storage().get_db().height(), hashes);
std::vector<block> pblocks;
- core.prepare_handle_incoming_blocks(blocks, pblocks);
+ if (!core.prepare_handle_incoming_blocks(blocks, pblocks))
+ {
+ MERROR("Failed to prepare to add blocks");
+ return 1;
+ }
if (!pblocks.empty() && pblocks.size() != blocks.size())
{
MERROR("Unexpected parsed blocks size");
diff --git a/src/blockchain_utilities/blockchain_prune.cpp b/src/blockchain_utilities/blockchain_prune.cpp
index 36080aade..8e13f2c04 100644
--- a/src/blockchain_utilities/blockchain_prune.cpp
+++ b/src/blockchain_utilities/blockchain_prune.cpp
@@ -611,24 +611,6 @@ 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);
diff --git a/src/blockchain_utilities/blockchain_stats.cpp b/src/blockchain_utilities/blockchain_stats.cpp
index 4cc84bf4a..33c26277e 100644
--- a/src/blockchain_utilities/blockchain_stats.cpp
+++ b/src/blockchain_utilities/blockchain_stats.cpp
@@ -205,7 +205,7 @@ plot 'stats.csv' index "DATA" using (timecolumn(1,"%Y-%m-%d")):4 with lines, ''
char buf[8];
unsigned int i;
for (i=0; i<24; i++) {
- sprintf(buf, "\t%02d:00", i);
+ sprintf(buf, "\t%02u:00", i);
std::cout << buf;
}
}