aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorLee *!* Clagett <code@leeclagett.com>2024-12-17 16:40:15 -0500
committerLee *!* Clagett <code@leeclagett.com>2025-02-14 13:29:57 -0500
commit01bcd52924244ec8d2a24c10fcef8959289d09ff (patch)
tree7aa82581901a978c3c7ba3b0f50ac8c84f753945 /src/cryptonote_core
parent23a11d851adef30aea1888da0a7dd23936c81ec1 (diff)
downloadmonzero-core-01bcd52924244ec8d2a24c10fcef8959289d09ff.tar.gz
monzero-core-01bcd52924244ec8d2a24c10fcef8959289d09ff.tar.xz
monzero-core-01bcd52924244ec8d2a24c10fcef8959289d09ff.zip
Fix build with boost ASIO 0.87. Support boost 1.66+
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp7
-rw-r--r--src/cryptonote_core/blockchain.h7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index d497d202e..5192943d7 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -30,6 +30,7 @@
#include <algorithm>
#include <cstdio>
+#include <boost/asio/dispatch.hpp>
#include <boost/filesystem.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/format.hpp>
@@ -375,9 +376,9 @@ bool Blockchain::init(BlockchainDB* db, const network_type nettype, bool offline
// create general purpose async service queue
- m_async_work_idle = std::unique_ptr < boost::asio::io_service::work > (new boost::asio::io_service::work(m_async_service));
+ m_async_work_idle = std::make_unique<boost::asio::executor_work_guard<boost::asio::io_context::executor_type>>(m_async_service.get_executor());
// we only need 1
- m_async_pool.create_thread(boost::bind(&boost::asio::io_service::run, &m_async_service));
+ m_async_pool.create_thread(boost::bind(&boost::asio::io_context::run, &m_async_service));
#if defined(PER_BLOCK_CHECKPOINT)
if (m_nettype != FAKECHAIN)
@@ -4760,7 +4761,7 @@ bool Blockchain::cleanup_handle_incoming_blocks(bool force_sync)
{
m_sync_counter = 0;
m_bytes_to_sync = 0;
- m_async_service.dispatch(boost::bind(&Blockchain::store_blockchain, this));
+ boost::asio::dispatch(m_async_service, boost::bind(&Blockchain::store_blockchain, this));
}
else if(m_db_sync_mode == db_sync)
{
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 42246fca2..fa0f6ce51 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -29,7 +29,8 @@
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#pragma once
-#include <boost/asio/io_service.hpp>
+#include <boost/asio/executor_work_guard.hpp>
+#include <boost/asio/io_context.hpp>
#include <boost/function/function_fwd.hpp>
#if BOOST_VERSION >= 107400
#include <boost/serialization/library_version_type.hpp>
@@ -1185,9 +1186,9 @@ namespace cryptonote
crypto::hash m_difficulty_for_next_block_top_hash;
difficulty_type m_difficulty_for_next_block;
- boost::asio::io_service m_async_service;
+ boost::asio::io_context m_async_service;
boost::thread_group m_async_pool;
- std::unique_ptr<boost::asio::io_service::work> m_async_work_idle;
+ std::unique_ptr<boost::asio::executor_work_guard<boost::asio::io_context::executor_type>> m_async_work_idle;
// some invalid blocks
blocks_ext_by_hash m_invalid_blocks; // crypto::hash -> block_extended_info