Init P2P server before Stratum server (fixed a data race)

This commit is contained in:
SChernykh 2024-10-23 18:41:18 +02:00
parent 831edc465a
commit c9193c53d9

View file

@ -996,8 +996,8 @@ void p2pool::download_block_headers(uint64_t current_height)
if (parse_block_headers_range(data, size) == current_height - start_height) {
update_median_timestamp();
if (m_serversStarted.exchange(1) == 0) {
m_stratumServer = new StratumServer(this);
m_p2pServer = new P2PServer(this);
m_stratumServer = new StratumServer(this);
#ifdef WITH_RANDOMX
if (m_params->m_minerThreads) {
start_mining(m_params->m_minerThreads);