mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 22:57:56 +02:00
kernel: Add import blocks function to C header
Add `btck_import_blocks` to import block data and rebuild indexes. The function can either reindex all existing block files if the indexes were previously wiped through the chainstate manager options, or import blocks from specified file paths.
This commit is contained in:
@@ -552,6 +552,9 @@ void chainman_reindex_test(TestDirectory& test_directory)
|
||||
auto notifications{std::make_shared<TestKernelNotifications>()};
|
||||
auto context{create_context(notifications, ChainType::MAINNET)};
|
||||
auto chainman{create_chainman(test_directory, true, false, false, false, context)};
|
||||
|
||||
std::vector<std::string> import_files;
|
||||
BOOST_CHECK(chainman->ImportBlocks(import_files));
|
||||
}
|
||||
|
||||
void chainman_reindex_chainstate_test(TestDirectory& test_directory)
|
||||
@@ -559,6 +562,10 @@ void chainman_reindex_chainstate_test(TestDirectory& test_directory)
|
||||
auto notifications{std::make_shared<TestKernelNotifications>()};
|
||||
auto context{create_context(notifications, ChainType::MAINNET)};
|
||||
auto chainman{create_chainman(test_directory, false, true, false, false, context)};
|
||||
|
||||
std::vector<std::string> import_files;
|
||||
import_files.push_back((test_directory.m_directory / "blocks" / "blk00000.dat").string());
|
||||
BOOST_CHECK(chainman->ImportBlocks(import_files));
|
||||
}
|
||||
|
||||
void chainman_mainnet_validation_test(TestDirectory& test_directory)
|
||||
|
||||
Reference in New Issue
Block a user