From 1efa0961aea2a3b3c898dbac37d0f3f972a7e224 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 24 Nov 2020 02:44:19 +0800 Subject: [PATCH] Fix building with boost >= 1.70 --- src/bitcoinrpc.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 01b168cc..15b96d34 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -645,7 +645,11 @@ public: } bool connect(const std::string& server, const std::string& port) { +#if BOOST_VERSION >= 107000 + ip::tcp::resolver resolver(static_cast(stream.get_executor().context())); +#else ip::tcp::resolver resolver(stream.get_io_service()); +#endif ip::tcp::resolver::query query(server.c_str(), port.c_str()); ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); ip::tcp::resolver::iterator end; @@ -732,7 +736,11 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor > accep const bool fUseSSL) { // Accept connection +#if BOOST_VERSION >= 107000 + AcceptedConnectionImpl* conn = new AcceptedConnectionImpl(static_cast(acceptor->get_executor().context()), context, fUseSSL); +#else AcceptedConnectionImpl* conn = new AcceptedConnectionImpl(acceptor->get_io_service(), context, fUseSSL); +#endif acceptor->async_accept( conn->sslStream.lowest_layer(),