Fixed pruning logic
- Erase an element from m_blocksByHeight only if it's empty - Remove blocks from unconnected alternative chains too when they get old enough (4xPPLNS window)
This commit is contained in:
@@ -52,6 +52,7 @@ PoolBlock::PoolBlock()
|
||||
, m_invalid(false)
|
||||
, m_broadcasted(false)
|
||||
, m_wantBroadcast(false)
|
||||
, m_localTimestamp(time(nullptr))
|
||||
{
|
||||
uv_mutex_init_checked(&m_lock);
|
||||
|
||||
@@ -114,6 +115,8 @@ PoolBlock& PoolBlock::operator=(const PoolBlock& b)
|
||||
m_broadcasted = b.m_broadcasted;
|
||||
m_wantBroadcast = b.m_wantBroadcast;
|
||||
|
||||
m_localTimestamp = time(nullptr);
|
||||
|
||||
if (lock_result == 0) {
|
||||
uv_mutex_unlock(&b.m_lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user