Electroneum
daemonize::t_core Class Referencefinal

#include <core.h>

Public Member Functions

 t_core (boost::program_options::variables_map const &vm)
 
void set_protocol (t_protocol_raw &protocol)
 
bool run ()
 
cryptonote::coreget ()
 
 ~t_core ()
 

Static Public Member Functions

static void init_options (boost::program_options::options_description &option_spec)
 

Detailed Description

Definition at line 43 of file core.h.

Constructor & Destructor Documentation

◆ t_core()

daemonize::t_core::t_core ( boost::program_options::variables_map const &  vm)
inline

Definition at line 57 of file core.h.

60  : m_core{nullptr}
61  , m_vm_HACK{vm}
62  {
63  }

◆ ~t_core()

daemonize::t_core::~t_core ( )
inline

Definition at line 93 of file core.h.

94  {
95  MGINFO("Deinitializing core...");
96  try {
97  m_core.deinit();
98  m_core.set_cryptonote_protocol(nullptr);
99  } catch (...) {
100  MERROR("Failed to deinitialize core...");
101  }
102  }
#define MERROR(x)
Definition: misc_log_ex.h:73
bool deinit()
performs safe shutdown steps for core and core components
#define MGINFO(x)
Definition: misc_log_ex.h:80
void set_cryptonote_protocol(i_cryptonote_protocol *pprotocol)
set the pointer to the cryptonote protocol object to use
Here is the call graph for this function:

Member Function Documentation

◆ get()

cryptonote::core& daemonize::t_core::get ( )
inline

Definition at line 88 of file core.h.

89  {
90  return m_core;
91  }
Here is the caller graph for this function:

◆ init_options()

static void daemonize::t_core::init_options ( boost::program_options::options_description &  option_spec)
inlinestatic

Definition at line 46 of file core.h.

47  {
48  cryptonote::core::init_options(option_spec);
49  }
static void init_options(boost::program_options::options_description &desc)
adds command line options to the given options set
Here is the call graph for this function:

◆ run()

bool daemonize::t_core::run ( )
inline

Definition at line 71 of file core.h.

72  {
73  //initialize core here
74  MGINFO("Initializing core...");
75 #if defined(PER_BLOCK_CHECKPOINT)
77 #else
78  const cryptonote::GetCheckpointsCallback& get_checkpoints = nullptr;
79 #endif
80  if (!m_core.init(m_vm_HACK, nullptr, get_checkpoints))
81  {
82  return false;
83  }
84  MGINFO("Core initialized OK");
85  return true;
86  }
bool init(const boost::program_options::variables_map &vm, const test_options *test_options=NULL, const GetCheckpointsCallback &get_checkpoints=nullptr)
initializes the core as needed
std::function< const epee::span< const unsigned char >cryptonote::network_type network)> GetCheckpointsCallback
Callback routine that returns checkpoints data for specific network type.
Definition: blockchain.h:92
#define MGINFO(x)
Definition: misc_log_ex.h:80
const epee::span< const unsigned char > GetCheckpointsData(cryptonote::network_type network)
Definition: blocks.cpp:21
Here is the call graph for this function:

◆ set_protocol()

void daemonize::t_core::set_protocol ( t_protocol_raw protocol)
inline

Definition at line 66 of file core.h.

67  {
68  m_core.set_cryptonote_protocol(&protocol);
69  }
void set_cryptonote_protocol(i_cryptonote_protocol *pprotocol)
set the pointer to the cryptonote protocol object to use
Here is the call graph for this function:

The documentation for this class was generated from the following file: