mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 11:29:23 +00:00
Couple more sanity checks
This commit is contained in:
parent
656f912a3e
commit
6d3cfa2c7a
2 changed files with 9 additions and 0 deletions
|
@ -1118,6 +1118,11 @@ void SideChain::update_chain_tip(PoolBlock* block)
|
|||
return;
|
||||
}
|
||||
|
||||
if (block->m_depth >= m_chainWindowSize) {
|
||||
LOGINFO(5, "Trying to update chain tip to a block with depth " << block->m_depth << ". Ignoring it.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_longer_chain(m_chainTip, block)) {
|
||||
difficulty_type diff;
|
||||
if (get_difficulty(block, m_difficultyData, diff)) {
|
||||
|
|
|
@ -100,6 +100,10 @@ void StratumServer::on_block(const BlockTemplate& block)
|
|||
m_blobsQueue.push_back(blobs_data);
|
||||
}
|
||||
|
||||
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(&m_blobsAsync))) {
|
||||
return;
|
||||
}
|
||||
|
||||
const int err = uv_async_send(&m_blobsAsync);
|
||||
if (err) {
|
||||
LOGERR(1, "uv_async_send failed, error " << uv_err_name(err));
|
||||
|
|
Loading…
Reference in a new issue