aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-07-15 00:53:35 +0200
committerRiccardo Spagni <ric@spagni.net>2015-07-15 00:53:45 +0200
commit9688e6fdd896f4034b1c0dd40c406cd83880f830 (patch)
tree9d74a8f9bfcf3e9c816feda1b9d720471886ad9d /src/blockchain_utilities
parentMerge pull request #333 (diff)
parentCheck and resize if needed at batch transaction start (diff)
downloadmonero-9688e6fdd896f4034b1c0dd40c406cd83880f830.tar.xz
Merge pull request #334
fd73d9c Check and resize if needed at batch transaction start (warptangent) f9e4afd blockchain_utilities: Increase debug statement's log level (warptangent) 699e4b3 blockchain_utilities: Pass expected number of blocks when starting batch (warptangent) 6e170c8 Optionally allow DB to know expected number of blocks at batch transaction start (warptangent)
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_converter.cpp4
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp4
-rw-r--r--src/blockchain_utilities/bootstrap_file.cpp2
-rw-r--r--src/blockchain_utilities/fake_core.h6
4 files changed, 8 insertions, 8 deletions
diff --git a/src/blockchain_utilities/blockchain_converter.cpp b/src/blockchain_utilities/blockchain_converter.cpp
index 855dde644..d18ce8789 100644
--- a/src/blockchain_utilities/blockchain_converter.cpp
+++ b/src/blockchain_utilities/blockchain_converter.cpp
@@ -236,7 +236,7 @@ int main(int argc, char* argv[])
}
if (opt_batch)
- blockchain->batch_start();
+ blockchain->batch_start(db_batch_size);
uint64_t i = 0;
for (i = start_block; i < end_block + 1; ++i)
{
@@ -277,7 +277,7 @@ int main(int argc, char* argv[])
std::cout << "\r \r";
std::cout << "[- batch commit at height " << i + 1 << " -]" << ENDL;
blockchain->batch_stop();
- blockchain->batch_start();
+ blockchain->batch_start(db_batch_size);
std::cout << ENDL;
blockchain->show_stats();
}
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index aeed2b335..924b46d2d 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -254,7 +254,7 @@ int import_from_file(FakeCore& simple_core, std::string& import_file_path, uint6
}
if (use_batch)
- simple_core.batch_start();
+ simple_core.batch_start(db_batch_size);
LOG_PRINT_L0("Reading blockchain from bootstrap file...");
std::cout << ENDL;
@@ -482,7 +482,7 @@ int import_from_file(FakeCore& simple_core, std::string& import_file_path, uint6
// zero-based height
std::cout << ENDL << "[- batch commit at height " << h-1 << " -]" << ENDL;
simple_core.batch_stop();
- simple_core.batch_start();
+ simple_core.batch_start(db_batch_size);
std::cout << ENDL;
#if !defined(BLOCKCHAIN_DB) || (BLOCKCHAIN_DB == DB_LMDB)
simple_core.m_storage.get_db().show_stats();
diff --git a/src/blockchain_utilities/bootstrap_file.cpp b/src/blockchain_utilities/bootstrap_file.cpp
index 70f0b1fec..573cb1572 100644
--- a/src/blockchain_utilities/bootstrap_file.cpp
+++ b/src/blockchain_utilities/bootstrap_file.cpp
@@ -454,7 +454,7 @@ uint64_t BootstrapFile::count_blocks(const std::string& import_file_path)
str1.assign(buf1, sizeof(chunk_size));
if (! ::serialization::parse_binary(str1, chunk_size))
throw std::runtime_error("Error in deserialization of chunk_size");
- LOG_PRINT_L1("chunk_size: " << chunk_size);
+ LOG_PRINT_L3("chunk_size: " << chunk_size);
if (chunk_size > BUFFER_SIZE)
{
diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h
index 79fb51842..5eda504fe 100644
--- a/src/blockchain_utilities/fake_core.h
+++ b/src/blockchain_utilities/fake_core.h
@@ -96,9 +96,9 @@ struct fake_core_lmdb
return m_storage.get_db().add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
}
- void batch_start()
+ void batch_start(uint64_t batch_num_blocks = 0)
{
- m_storage.get_db().batch_start();
+ m_storage.get_db().batch_start(batch_num_blocks);
}
void batch_stop()
@@ -150,7 +150,7 @@ struct fake_core_memory
return 2;
}
- void batch_start()
+ void batch_start(uint64_t batch_num_blocks = 0)
{
LOG_PRINT_L0("WARNING: [batch_start] opt_batch set, but this database doesn't support/need transactions - ignoring");
}