diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-19 09:39:51 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-19 09:41:25 +0200 |
commit | b64b1c6e9f28ab5c4a056673fcce8da0afcaa4ec (patch) | |
tree | 62902a54eb064070ffb02878cd0f0ef37ebaca1b | |
parent | a3788527a2bb882106e2a57ce51fa6ddca527779 (diff) |
rpc: Add acceptors only when listening succeeded
Rebased-From: 6afa493
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
-rw-r--r-- | src/rpcserver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 205cbf2d79..f43acf41ba 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -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; } } |