mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Ledger maintenance refactor. (#130)
* Added ledger namespace. * Thread-safe lcl access and update. * Refactored history sync and serving into a thread. * Restructured ledger cache item.
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -11,7 +11,8 @@
|
||||
#include "usr/usr.hpp"
|
||||
#include "usr/read_req.hpp"
|
||||
#include "p2p/p2p.hpp"
|
||||
#include "cons/cons.hpp"
|
||||
#include "consensus.hpp"
|
||||
#include "ledger.hpp"
|
||||
#include "hpfs/hpfs.hpp"
|
||||
#include "state/state_sync.hpp"
|
||||
#include "state/state_serve.hpp"
|
||||
@@ -67,7 +68,8 @@ int parse_cmd(int argc, char **argv)
|
||||
*/
|
||||
void deinit()
|
||||
{
|
||||
cons::deinit();
|
||||
consensus::deinit();
|
||||
ledger::deinit();
|
||||
state_sync::deinit();
|
||||
state_serve::deinit();
|
||||
read_req::deinit();
|
||||
@@ -191,7 +193,7 @@ int main(int argc, char **argv)
|
||||
LOG_INFO << "Public key: " << conf::cfg.pubkeyhex.substr(2); // Public key without 'ed' prefix.
|
||||
|
||||
if (hpfs::init() != 0 || p2p::init() != 0 || usr::init() != 0 || read_req::init() != 0 ||
|
||||
state_serve::init() != 0 || state_sync::init() != 0 || cons::init() != 0)
|
||||
state_serve::init() != 0 || state_sync::init() != 0 || ledger::init() || consensus::init() != 0)
|
||||
{
|
||||
deinit();
|
||||
return -1;
|
||||
@@ -201,7 +203,7 @@ int main(int argc, char **argv)
|
||||
signal(SIGINT, &sigint_handler);
|
||||
|
||||
// Wait until consensus thread finishes.
|
||||
cons::wait();
|
||||
consensus::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.
|
||||
|
||||
Reference in New Issue
Block a user