Fixed donation mode logging, fixed sidechain banner messaging/timing
This commit is contained in:
@@ -301,7 +301,9 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const
|
||||
}
|
||||
m_shares.clear();
|
||||
m_shares.emplace_back(total_weight, ¶ms->m_devWallet);
|
||||
LOGINFO(3, "Entering donation mode at height " << data.height << ": share reward is donated to developer");
|
||||
if (!m_lastWasDonation) {
|
||||
LOGINFO(3, "Entering donation mode at height " << data.height << ": share reward is donated to developer");
|
||||
}
|
||||
m_lastWasDonation = true;
|
||||
}
|
||||
else if (m_lastWasDonation) {
|
||||
|
||||
@@ -1442,29 +1442,37 @@ void p2pool::download_block_headers4(uint64_t start_height, uint64_t current_hei
|
||||
if (parse_block_headers_range(data, size) == current_height - start_height) {
|
||||
update_median_timestamp();
|
||||
if (m_serversStarted.exchange(1) == 0) {
|
||||
m_p2pServer = new P2PServer(this);
|
||||
|
||||
// Display loading banner
|
||||
// Display loading banner before starting P2P (which triggers cache bootstrap)
|
||||
LOGINFO(0, log::LightCyan() << "########################################################");
|
||||
LOGINFO(0, log::LightCyan() << "LOADING SIDECHAIN - MINING MAY NOT OCCUR UNTIL COMPLETE");
|
||||
LOGINFO(0, log::LightCyan() << "########################################################");
|
||||
|
||||
|
||||
m_p2pServer = new P2PServer(this);
|
||||
|
||||
// Wait for sidechain to be ready before starting stratum/mining
|
||||
int genesis_wait_count = 0;
|
||||
bool genesis_escape = false;
|
||||
while (!m_sideChain->is_ready_to_mine()) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
genesis_wait_count++;
|
||||
|
||||
|
||||
// Genesis node escape: if we created genesis and have no peers, proceed
|
||||
if (m_p2pServer && m_p2pServer->num_connections() == 0 && genesis_wait_count >= 6) {
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
LOGINFO(0, log::LightGreen() << "GENESIS NODE - MINING IS NOW ENABLED");
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
m_sideChain->set_ready_to_mine(true);
|
||||
genesis_escape = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!genesis_escape) {
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
LOGINFO(0, log::LightGreen() << "SIDECHAIN LOADED - MINING IS NOW ENABLED");
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
}
|
||||
|
||||
m_stratumServer = new StratumServer(this);
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
if (m_params->m_minerThreads) {
|
||||
|
||||
@@ -2224,10 +2224,7 @@ void SideChain::update_chain_tip(PoolBlock* block)
|
||||
}
|
||||
// Only enable mining when tip is verified at low depth (real-time, not catch-up)
|
||||
if (current_tip && current_tip->m_verified && have_checkpoint && current_tip->m_depth < 10) {
|
||||
m_readyToMine.store(true);
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
LOGINFO(0, log::LightGreen() << "SIDECHAIN LOADED - MINING IS NOW ENABLED");
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
m_readyToMine.store(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2664,9 +2661,6 @@ void SideChain::prune_old_blocks()
|
||||
const PoolBlock* current_tip = m_chainTip.load();
|
||||
if (current_tip && current_tip->m_verified) {
|
||||
m_readyToMine.store(true);
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
LOGINFO(0, log::LightGreen() << "SIDECHAIN LOADED - MINING IS NOW ENABLED");
|
||||
LOGINFO(0, log::LightGreen() << "########################################");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user