Removing null checks for nano::bootstrap::socket since it's required to be non-null on construction and is never nulled out during execution. (#3441)
This commit is contained in:
parent
7337ea536f
commit
2e769bf5b9
2 changed files with 10 additions and 21 deletions
|
|
@ -135,12 +135,9 @@ nano::bootstrap_server::~bootstrap_server ()
|
||||||
void nano::bootstrap_server::stop ()
|
void nano::bootstrap_server::stop ()
|
||||||
{
|
{
|
||||||
if (!stopped.exchange (true))
|
if (!stopped.exchange (true))
|
||||||
{
|
|
||||||
if (socket != nullptr)
|
|
||||||
{
|
{
|
||||||
socket->close ();
|
socket->close ();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void nano::bootstrap_server::receive ()
|
void nano::bootstrap_server::receive ()
|
||||||
|
|
@ -583,8 +580,6 @@ void nano::bootstrap_server::finish_request_async ()
|
||||||
|
|
||||||
void nano::bootstrap_server::timeout ()
|
void nano::bootstrap_server::timeout ()
|
||||||
{
|
{
|
||||||
if (socket != nullptr)
|
|
||||||
{
|
|
||||||
if (socket->has_timed_out ())
|
if (socket->has_timed_out ())
|
||||||
{
|
{
|
||||||
if (node->config.logging.bulk_pull_logging ())
|
if (node->config.logging.bulk_pull_logging ())
|
||||||
|
|
@ -597,12 +592,6 @@ void nano::bootstrap_server::timeout ()
|
||||||
}
|
}
|
||||||
socket->close ();
|
socket->close ();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nano::lock_guard<nano::mutex> lock (node->bootstrap.mutex);
|
|
||||||
node->bootstrap.connections.erase (this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public:
|
||||||
bool is_bootstrap_connection ();
|
bool is_bootstrap_connection ();
|
||||||
bool is_realtime_connection ();
|
bool is_realtime_connection ();
|
||||||
std::shared_ptr<std::vector<uint8_t>> receive_buffer;
|
std::shared_ptr<std::vector<uint8_t>> receive_buffer;
|
||||||
std::shared_ptr<nano::socket> socket;
|
std::shared_ptr<nano::socket> const socket;
|
||||||
std::shared_ptr<nano::node> node;
|
std::shared_ptr<nano::node> node;
|
||||||
nano::mutex mutex;
|
nano::mutex mutex;
|
||||||
std::queue<std::unique_ptr<nano::message>> requests;
|
std::queue<std::unique_ptr<nano::message>> requests;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue