more backport

pull/7/head
Jeff Becker 6 years ago
parent f7daee5abf
commit a9c92213df

@ -11,13 +11,12 @@ namespace llarp
{
struct Context
{
Context(bool signleThread = false);
~Context();
int num_nethreads = 1;
bool singleThreaded = false;
std::vector< std::thread > netio_threads;
llarp_crypto crypto;
llarp_crypto crypto = {};
llarp_router *router = nullptr;
llarp_threadpool *worker = nullptr;
llarp_logic *logic = nullptr;

@ -12,12 +12,6 @@
namespace llarp
{
Context::Context(bool singleThread)
{
singleThreaded = singleThread;
llarp::LogInfo(LLARP_VERSION, " ", LLARP_RELEASE_MOTTO);
}
Context::~Context()
{
}
@ -134,6 +128,7 @@ namespace llarp
int
Context::Setup()
{
llarp::LogInfo(LLARP_VERSION, " ", LLARP_RELEASE_MOTTO);
llarp::LogInfo("starting up");
this->LoadDatabase();
llarp_ev_loop_alloc(&mainloop);
@ -311,7 +306,8 @@ llarp_main_init(const char *fname, bool multiProcess)
cSetLogLevel(eLogDebug);
}
llarp_main *m = new llarp_main;
m->ctx.reset(new llarp::Context(!multiProcess));
m->ctx.reset(new llarp::Context());
m->ctx->singleThreaded = !multiProcess;
if(!m->ctx->LoadConfig(fname))
{
m->ctx->Close();

Loading…
Cancel
Save