Don't init gRPC if it's not used
This commit is contained in:
@@ -21,6 +21,11 @@
|
||||
#include "p2p_server.h"
|
||||
#include <fstream>
|
||||
|
||||
#ifdef WITH_GRPC
|
||||
#include "merge_mining_client.h"
|
||||
#include "merge_mining_client_tari.h"
|
||||
#endif
|
||||
|
||||
LOG_CATEGORY(Params)
|
||||
|
||||
void p2pool_usage();
|
||||
@@ -476,6 +481,20 @@ bool Params::valid() const
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef WITH_GRPC
|
||||
bool Params::grpc_needed() const
|
||||
{
|
||||
for (const MergeMiningHost& h : m_mergeMiningHosts) {
|
||||
if (h.m_host.find(MergeMiningClientTari::TARI_PREFIX) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Params::Host::init_display_name(const Params& p)
|
||||
{
|
||||
m_displayName = m_address;
|
||||
|
||||
Reference in New Issue
Block a user