fortuna: move whole ctor code into a try block
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c852c723fd
commit
b24cf7566a
11
fortuna.cpp
11
fortuna.cpp
|
@ -27,12 +27,8 @@ auto now{std::chrono::steady_clock::now()};
|
|||
Fortuna::Fortuna() {
|
||||
try {
|
||||
initialize_prng();
|
||||
|
||||
this->sync_point.wait(); // wait for init
|
||||
}
|
||||
catch (CryptoPP::Exception& e) {
|
||||
fmt::print(stderr, "{}\n", e.what());
|
||||
// perhaps die on error
|
||||
}
|
||||
|
||||
th_gen = std::thread(&Fortuna::generator_service,
|
||||
this,
|
||||
|
@ -40,6 +36,11 @@ Fortuna::Fortuna() {
|
|||
th_accu = std::thread(&Fortuna::accumulator_service, this);
|
||||
th_sfm = std::thread(&Fortuna::seed_file_manager_service, this);
|
||||
th_urandom = std::thread(&Fortuna::urandom_entropy_src_service, this);
|
||||
}
|
||||
catch (CryptoPP::Exception& e) {
|
||||
fmt::print(stderr, "{}\n", e.what());
|
||||
// perhaps die on error
|
||||
}
|
||||
}
|
||||
Fortuna::~Fortuna() noexcept {
|
||||
if (th_gen.joinable()) {
|
||||
|
|
Reference in New Issue