Skip to content

Commit 7760e86

Browse files
authored
Merge pull request #704 from evoskuil/master
Provide error code with directory create failure.
2 parents 075943b + 3fe83b9 commit 7760e86

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

console/executor_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ bool executor::check_store_path(bool create) const
5959
if (create)
6060
{
6161
logger(format(BN_INITIALIZING_CHAIN) % store);
62-
if (!database::file::create_directory(store))
62+
if (auto ec = database::file::create_directory_ex(store))
6363
{
64-
logger(format(BN_INITCHAIN_EXISTS) % store);
64+
logger(format(BN_INITCHAIN_DIRECTORY_ERROR) % store % ec.message());
6565
return false;
6666
}
6767
}

console/localize.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ namespace node {
3838
// --initchain
3939
#define BN_INITIALIZING_CHAIN \
4040
"Initializing %1% directory..."
41-
#define BN_INITCHAIN_EXISTS \
42-
"Failed because the directory %1% already exists."
41+
#define BN_INITCHAIN_DIRECTORY_ERROR \
42+
"Failed creating directory %1% with error '%2%'."
4343
#define BN_INITCHAIN_CREATING \
4444
"Please wait while creating the database..."
4545
#define BN_INITCHAIN_CREATED \

src/chasers/chaser_validate.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,14 @@ bool chaser_validate::update_neutrino(const header_link& link,
347347
if (!query.neutrino_enabled())
348348
return true;
349349

350+
// Filters are computed during validate, in parallel.
351+
// Validation skipped under checkpoint/milestone to only compute filter.
350352
data_chunk filter{};
351353
if (!compute_filter(filter, block))
352354
return false;
353355

356+
// TODO: move filter header computation to confirmation chaser (ordered).
357+
// TODO: this requires distinct storage array[n, 256] for filter headers.
354358
neutrino_ = compute_filter_header(neutrino_, filter);
355359
return query.set_filter(link, neutrino_, filter);
356360
}

0 commit comments

Comments
 (0)