blockchain_import: warn for chunks over 500000, not 100000

We have a lot of 350000 byte blocks now.
This commit is contained in:
moneromooo-monero 2017-09-01 12:00:25 +01:00
parent 2f9a5528a7
commit 2289ead568
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 5 additions and 4 deletions

View file

@ -316,9 +316,9 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
MWARNING("WARNING: chunk_size " << chunk_size << " > BUFFER_SIZE " << BUFFER_SIZE); MWARNING("WARNING: chunk_size " << chunk_size << " > BUFFER_SIZE " << BUFFER_SIZE);
throw std::runtime_error("Aborting: chunk size exceeds buffer size"); throw std::runtime_error("Aborting: chunk size exceeds buffer size");
} }
if (chunk_size > 100000) if (chunk_size > CHUNK_SIZE_WARNING_THRESHOLD)
{ {
MINFO("NOTE: chunk_size " << chunk_size << " > 100000"); MINFO("NOTE: chunk_size " << chunk_size << " > " << CHUNK_SIZE_WARNING_THRESHOLD);
} }
else if (chunk_size == 0) { else if (chunk_size == 0) {
MFATAL("ERROR: chunk_size == 0"); MFATAL("ERROR: chunk_size == 0");

View file

@ -34,6 +34,7 @@
// bounds checking is done before writing to buffer, but buffer size // bounds checking is done before writing to buffer, but buffer size
// should be a sensible maximum // should be a sensible maximum
#define BUFFER_SIZE 1000000 #define BUFFER_SIZE 1000000
#define CHUNK_SIZE_WARNING_THRESHOLD 500000
#define NUM_BLOCKS_PER_CHUNK 1 #define NUM_BLOCKS_PER_CHUNK 1
#define BLOCKCHAIN_RAW "blockchain.raw" #define BLOCKCHAIN_RAW "blockchain.raw"

View file

@ -436,10 +436,10 @@ uint64_t BootstrapFile::count_blocks(const std::string& import_file_path)
<< " height: " << h-1); << " height: " << h-1);
throw std::runtime_error("Aborting: chunk size exceeds buffer size"); throw std::runtime_error("Aborting: chunk size exceeds buffer size");
} }
if (chunk_size > 100000) if (chunk_size > CHUNK_SIZE_WARNING_THRESHOLD)
{ {
std::cout << refresh_string; std::cout << refresh_string;
MDEBUG("NOTE: chunk_size " << chunk_size << " > 100000" << " height: " MDEBUG("NOTE: chunk_size " << chunk_size << " > " << CHUNK_SIZE_WARNING_THRESHOLD << " << height: "
<< h-1); << h-1);
} }
else if (chunk_size <= 0) { else if (chunk_size <= 0) {