mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 09:19:24 +00:00
Ignore duplicate get_miner_data
This commit is contained in:
parent
3406cf78b4
commit
710e55422a
2 changed files with 11 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
#include "crypto.h"
|
||||
#include "p2pool_api.h"
|
||||
#include "pool_block.h"
|
||||
#include "keccak.h"
|
||||
#include <thread>
|
||||
#include <fstream>
|
||||
|
||||
|
@ -927,6 +928,14 @@ void p2pool::get_miner_data()
|
|||
|
||||
void p2pool::parse_get_miner_data_rpc(const char* data, size_t size)
|
||||
{
|
||||
hash h;
|
||||
keccak(reinterpret_cast<const uint8_t*>(data), static_cast<int>(size), h.h, HASH_SIZE);
|
||||
if (h == m_getMinerDataHash) {
|
||||
LOGWARN(4, "Received a duplicate get_miner_data RPC response, ignoring it");
|
||||
return;
|
||||
}
|
||||
m_getMinerDataHash = h;
|
||||
|
||||
rapidjson::Document doc;
|
||||
doc.Parse<rapidjson::kParseCommentsFlag | rapidjson::kParseTrailingCommasFlag>(data, size);
|
||||
|
||||
|
|
|
@ -202,6 +202,8 @@ private:
|
|||
uv_async_t m_restartZMQAsync;
|
||||
|
||||
ZMQReader* m_ZMQReader = nullptr;
|
||||
|
||||
hash m_getMinerDataHash;
|
||||
};
|
||||
|
||||
} // namespace p2pool
|
||||
|
|
Loading…
Reference in a new issue