Add sync mode to prevent mining during sidechain load
- Added m_readyToMine flag to SideChain - Display LOADING SIDECHAIN banner at startup - Delay stratum server and mining until sidechain sync completes - Display MINING IS NOW ENABLED when ready - Prevents premature mining that caused peer bans and chain splits P2PServer starts immediately for sync, but stratum port doesn't open until sidechain is fully loaded and after pruning completes
This commit is contained in:
@@ -2447,6 +2447,15 @@ void SideChain::prune_old_blocks()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// If side-chain started pruning blocks it means the initial sync is complete
|
||||
// It's now safe to delete cached blocks
|
||||
if (!m_readyToMine.load()) {
|
||||
m_readyToMine.store(true);
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
LOGINFO(0, log::LightGreen() << "SIDECHAIN LOADED - MINING IS NOW ENABLED");
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
}
|
||||
}
|
||||
|
||||
void SideChain::get_missing_blocks(unordered_set<hash>& missing_blocks) const
|
||||
|
||||
Reference in New Issue
Block a user