mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
rpc: Add acceptors only when listening succeeded
Rebased-From: 6afa493
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
@@ -566,7 +566,6 @@ void StartRPCThreads()
|
||||
try
|
||||
{
|
||||
boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(*rpc_io_service));
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
acceptor->open(endpoint.protocol());
|
||||
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
|
||||
|
||||
@@ -578,6 +577,7 @@ void StartRPCThreads()
|
||||
|
||||
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
|
||||
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
fListening = true;
|
||||
}
|
||||
catch(boost::system::system_error &e)
|
||||
@@ -592,7 +592,6 @@ void StartRPCThreads()
|
||||
endpoint.address(bindAddress);
|
||||
|
||||
boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(*rpc_io_service));
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
acceptor->open(endpoint.protocol());
|
||||
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
|
||||
acceptor->bind(endpoint);
|
||||
@@ -600,6 +599,7 @@ void StartRPCThreads()
|
||||
|
||||
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
|
||||
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
fListening = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user