Code cleanup

pull/181/head
SChernykh 2 years ago
parent acf37ff10f
commit 2aa8d2bdcc

@ -101,7 +101,7 @@ void p2pool_api::on_stop()
uv_close(reinterpret_cast<uv_handle_t*>(&m_dumpToFileAsync), nullptr);
}
void p2pool_api::dump_to_file_async_internal(const Category& category, const char* filename, DumpFileCallbackBase&& callback)
void p2pool_api::dump_to_file_async_internal(Category category, const char* filename, DumpFileCallbackBase&& callback)
{
std::vector<char> buf(16384);
log::Stream s(buf.data(), buf.size());

@ -38,7 +38,7 @@ public:
void on_stop();
template<typename T>
void set(const Category& category, const char* filename, T&& callback) { dump_to_file_async_internal(category, filename, DumpFileCallback<T>(std::move(callback))); }
void set(Category category, const char* filename, T&& callback) { dump_to_file_async_internal(category, filename, DumpFileCallback<T>(std::move(callback))); }
private:
void create_dir(const std::string& path);
@ -72,7 +72,7 @@ private:
T m_callback;
};
void dump_to_file_async_internal(const Category& category, const char* filename, DumpFileCallbackBase&& callback);
void dump_to_file_async_internal(Category category, const char* filename, DumpFileCallbackBase&& callback);
void dump_to_file();
static void on_fs_open(uv_fs_t* req);
static void on_fs_write(uv_fs_t* req);

@ -440,7 +440,9 @@ bool RandomX_Hasher_RPC::calculate(const void* data_ptr, size_t size, uint64_t h
volatile int result = 0;
volatile bool done = false;
JSONRPCRequest::call(m_pool->params().m_host, m_pool->params().m_rpcPort, buf, m_pool->params().m_rpcLogin,
const Params& params = m_pool->params();
JSONRPCRequest::call(params.m_host, params.m_rpcPort, buf, params.m_rpcLogin,
[&result, &h](const char* data, size_t size)
{
rapidjson::Document doc;

Loading…
Cancel
Save