mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 11:29:23 +00:00
Don't return stale chain tip to other peers
This commit is contained in:
parent
8fa354796c
commit
3406cf78b4
1 changed files with 6 additions and 1 deletions
|
@ -584,8 +584,13 @@ bool SideChain::get_block_blob(const hash& id, std::vector<uint8_t>& blob)
|
|||
const PoolBlock* block = nullptr;
|
||||
|
||||
// Empty hash means we return current sidechain tip
|
||||
if (id == hash()) {
|
||||
if (id.empty()) {
|
||||
block = m_chainTip;
|
||||
|
||||
// Don't return stale chain tip
|
||||
if (block && (block->m_txinGenHeight + 2 < m_pool->miner_data().height)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
auto it = m_blocksById.find(id);
|
||||
|
|
Loading…
Reference in a new issue