diff --git a/CMakeLists.txt b/CMakeLists.txt index 708627d..294be04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.5.0) project(monero-lws) enable_language(CXX) @@ -161,7 +161,7 @@ if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) endif() -find_package(Boost 1.70 QUIET REQUIRED COMPONENTS chrono coroutine filesystem program_options regex serialization system thread) +find_package(Boost 1.70 QUIET REQUIRED COMPONENTS chrono context coroutine filesystem program_options regex serialization system thread) if (NOT (Boost_THREAD_LIBRARY STREQUAL monero_Boost_THREAD_LIBRARY_RELEASE)) message(STATUS "Found Boost_THREAD_LIBRARY: ${Boost_THREAD_LIBRARY}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f6a9072..c750849 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,6 +56,7 @@ target_link_libraries(monero-lws-daemon-common monero-lws-wire-json monero-lws-util ${Boost_CHRONO_LIBRARY} + ${Boost_CONTEXT_LIBRARY} ${Boost_COROUTINE_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY} diff --git a/src/rest_server.cpp b/src/rest_server.cpp index 001c7c6..facf6dc 100644 --- a/src/rest_server.cpp +++ b/src/rest_server.cpp @@ -993,7 +993,18 @@ namespace lws lock.unlock(); MDEBUG("Starting new ZMQ coroutine in /get_random_outs"); +#if BOOST_VERSION >= 108000 + { + auto token = [] (const std::exception_ptr& e) + { + if (e) + std::rethrow_exception(e); + }; + boost::asio::spawn(active->strand, async_handler{active}, std::move(token)); + } +#else boost::asio::spawn(active->strand, async_handler{active}); +#endif return success(); } };