mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Refactored consensus to run on a separate thread. (#123)
This commit is contained in:
committed by
GitHub
parent
180b1ec714
commit
37629471c5
10
src/main.cpp
10
src/main.cpp
@@ -201,13 +201,11 @@ int main(int argc, char **argv)
|
||||
// After initializing primary subsystems, register the SIGINT handler.
|
||||
signal(SIGINT, &sigint_handler);
|
||||
|
||||
if (cons::run_consensus() == -1)
|
||||
{
|
||||
LOG_ERR << "Error occured in consensus.";
|
||||
deinit();
|
||||
return -1;
|
||||
}
|
||||
// Wait until consensus thread finishes.
|
||||
cons::wait();
|
||||
|
||||
// deinit() here only gets called when there is an error in consensus.
|
||||
// If not deinit in the sigint handler is called when a SIGINT is received.
|
||||
deinit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user