diff --git a/include/bitcoin/network/net/socket.hpp b/include/bitcoin/network/net/socket.hpp index eec1e7edc..de8baadf1 100644 --- a/include/bitcoin/network/net/socket.hpp +++ b/include/bitcoin/network/net/socket.hpp @@ -251,7 +251,7 @@ class BCT_API socket const result_handler& handler) NOEXCEPT; // connection - void handle_accept(const boost_code& ec, + void handle_accept(boost_code ec, const result_handler& handler) NOEXCEPT; void handle_connect(const boost_code& ec, const asio::endpoint& peer, const result_handler& handler) NOEXCEPT; diff --git a/src/net/socket.cpp b/src/net/socket.cpp index 98432921d..41f25003c 100644 --- a/src/net/socket.cpp +++ b/src/net/socket.cpp @@ -581,7 +581,7 @@ void socket::do_ws_event(ws::frame_type kind, // ---------------------------------------------------------------------------- // These are invoked on strand upon failure, socket cancel, or completion. -void socket::handle_accept(const boost_code& ec, +void socket::handle_accept(boost_code ec, const result_handler& handler) NOEXCEPT { // This is running in the acceptor (not socket) execution context. @@ -589,7 +589,7 @@ void socket::handle_accept(const boost_code& ec, // address_ remains defaulted for inbound (accepted) connections. if (!ec) - authority_ = { socket_.remote_endpoint() }; + authority_ = { socket_.remote_endpoint(ec) }; if (error::asio_is_canceled(ec)) {