mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Remove unused init_core_callback, inline lambdas
This commit is contained in:
parent
e40c7a0995
commit
f50e3ce898
|
@ -270,25 +270,12 @@ namespace cryptonote
|
|||
[[noreturn]] static void need_core_init() {
|
||||
throw std::logic_error("Internal error: core callback initialization was not performed!");
|
||||
}
|
||||
void (*long_poll_trigger)(tx_memory_pool& pool);
|
||||
|
||||
quorumnet_new_proc *quorumnet_new;
|
||||
quorumnet_delete_proc *quorumnet_delete;
|
||||
quorumnet_relay_obligation_votes_proc *quorumnet_relay_obligation_votes;
|
||||
quorumnet_send_blink_proc *quorumnet_send_blink;
|
||||
static bool init_core_callback_stubs() {
|
||||
quorumnet_new = [](core&) -> void* { need_core_init(); };
|
||||
quorumnet_delete = [](void*&) { need_core_init(); };
|
||||
quorumnet_relay_obligation_votes = [](void*, const std::vector<service_nodes::quorum_vote_t>&) { need_core_init(); };
|
||||
quorumnet_send_blink = [](core&, const std::string&) -> std::future<std::pair<blink_result, std::string>> { need_core_init(); };
|
||||
|
||||
long_poll_trigger = [](tx_memory_pool&) { need_core_init(); };
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// This variable is only here to let us call the above during static initialization.
|
||||
bool init_core_callback_complete = init_core_callback_stubs();
|
||||
void (*long_poll_trigger)(tx_memory_pool& pool) = [](tx_memory_pool&) { need_core_init(); };
|
||||
quorumnet_new_proc *quorumnet_new = [](core&) -> void* { need_core_init(); };
|
||||
quorumnet_delete_proc *quorumnet_delete = [](void*&) { need_core_init(); };
|
||||
quorumnet_relay_obligation_votes_proc *quorumnet_relay_obligation_votes = [](void*, const std::vector<service_nodes::quorum_vote_t>&) { need_core_init(); };
|
||||
quorumnet_send_blink_proc *quorumnet_send_blink = [](core&, const std::string&) -> std::future<std::pair<blink_result, std::string>> { need_core_init(); };
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
core::core()
|
||||
|
|
|
@ -100,7 +100,6 @@ namespace cryptonote
|
|||
extern quorumnet_delete_proc *quorumnet_delete;
|
||||
extern quorumnet_relay_obligation_votes_proc *quorumnet_relay_obligation_votes;
|
||||
extern quorumnet_send_blink_proc *quorumnet_send_blink;
|
||||
extern bool init_core_callback_complete;
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
|
|
Loading…
Reference in a new issue