mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-22 10:24:31 +00:00
Limit autodiff to 4M for max compatibility
This commit is contained in:
parent
0bda37057a
commit
b267c19a45
1 changed files with 7 additions and 0 deletions
|
@ -251,6 +251,10 @@ bool StratumServer::on_login(StratumClient* client, uint32_t id, const char* log
|
|||
LOGINFO(5, "client " << log::Gray() << static_cast<char*>(client->m_addrString) << " set custom difficulty " << client->m_customDiff);
|
||||
target = std::max(target, client->m_customDiff.target());
|
||||
}
|
||||
else if (m_autoDiff) {
|
||||
// Limit autodiff to 4000000 for maximum compatibility
|
||||
target = std::max(target, TARGET_4_BYTES_LIMIT);
|
||||
}
|
||||
|
||||
if (get_custom_user(login, client->m_customUser)) {
|
||||
const char* s = client->m_customUser;
|
||||
|
@ -686,6 +690,9 @@ void StratumServer::on_blobs_ready()
|
|||
target = std::max(target, client->m_customDiff.target());
|
||||
}
|
||||
else if (m_autoDiff) {
|
||||
// Limit autodiff to 4000000 for maximum compatibility
|
||||
target = std::max(target, TARGET_4_BYTES_LIMIT);
|
||||
|
||||
if (client->m_autoDiff.lo) {
|
||||
const uint32_t k = client->m_autoDiffIndex;
|
||||
const uint16_t elapsed_time = static_cast<uint16_t>(cur_time) - client->m_autoDiffData[(k - 1) % StratumClient::AUTO_DIFF_SIZE].m_timestamp;
|
||||
|
|
Loading…
Reference in a new issue