mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-09-29 21:41:02 +00:00
Code cleanup
This commit is contained in:
parent
acf37ff10f
commit
2aa8d2bdcc
3 changed files with 6 additions and 4 deletions
|
@ -101,7 +101,7 @@ void p2pool_api::on_stop()
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(&m_dumpToFileAsync), nullptr);
|
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);
|
std::vector<char> buf(16384);
|
||||||
log::Stream s(buf.data(), buf.size());
|
log::Stream s(buf.data(), buf.size());
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
void on_stop();
|
void on_stop();
|
||||||
|
|
||||||
template<typename T>
|
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:
|
private:
|
||||||
void create_dir(const std::string& path);
|
void create_dir(const std::string& path);
|
||||||
|
@ -72,7 +72,7 @@ private:
|
||||||
T m_callback;
|
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();
|
void dump_to_file();
|
||||||
static void on_fs_open(uv_fs_t* req);
|
static void on_fs_open(uv_fs_t* req);
|
||||||
static void on_fs_write(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 int result = 0;
|
||||||
volatile bool done = false;
|
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)
|
[&result, &h](const char* data, size_t size)
|
||||||
{
|
{
|
||||||
rapidjson::Document doc;
|
rapidjson::Document doc;
|
||||||
|
|
Loading…
Reference in a new issue