mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-17 08:17:55 +00:00
Fixed cppcheck error
This commit is contained in:
parent
2e6041dcf5
commit
3697c079fa
2 changed files with 3 additions and 9 deletions
|
@ -1545,11 +1545,7 @@ bool P2PServer::P2PClient::on_read(char* data, uint32_t size)
|
|||
m_pingTime = std::max<int64_t>(duration_cast<milliseconds>(high_resolution_clock::now() - m_lastPeerListRequestTime).count(), 0);
|
||||
|
||||
--m_peerListPendingRequests;
|
||||
if (!on_peer_list_response(buf + 1)) {
|
||||
ban(DEFAULT_BAN_TIME);
|
||||
server->remove_peer_from_list(this);
|
||||
return false;
|
||||
}
|
||||
on_peer_list_response(buf + 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -2181,7 +2177,7 @@ bool P2PServer::P2PClient::on_peer_list_request(const uint8_t*)
|
|||
});
|
||||
}
|
||||
|
||||
bool P2PServer::P2PClient::on_peer_list_response(const uint8_t* buf)
|
||||
void P2PServer::P2PClient::on_peer_list_response(const uint8_t* buf)
|
||||
{
|
||||
P2PServer* server = static_cast<P2PServer*>(m_owner);
|
||||
const uint64_t cur_time = seconds_since_epoch();
|
||||
|
@ -2242,8 +2238,6 @@ bool P2PServer::P2PClient::on_peer_list_response(const uint8_t* buf)
|
|||
server->m_peerList.emplace_back(Peer{ is_v6, ip, port, 0, cur_time });
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool P2PServer::P2PClient::handle_incoming_block_async(const PoolBlock* block, uint64_t max_time_delta)
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
bool on_block_response(const uint8_t* buf, uint32_t size, const hash& expected_id);
|
||||
bool on_block_broadcast(const uint8_t* buf, uint32_t size, bool compact);
|
||||
bool on_peer_list_request(const uint8_t* buf);
|
||||
bool on_peer_list_response(const uint8_t* buf);
|
||||
void on_peer_list_response(const uint8_t* buf);
|
||||
|
||||
bool handle_incoming_block_async(const PoolBlock* block, uint64_t max_time_delta = 0);
|
||||
void handle_incoming_block(p2pool* pool, PoolBlock& block, const uint32_t reset_counter, const raw_ip& addr, std::vector<hash>& missing_blocks);
|
||||
|
|
Loading…
Reference in a new issue