From 92b63020b4d9b86950a11f5afbf8d3a14701f8d2 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nicolas.pope@utu.fi> Date: Tue, 10 May 2022 17:27:07 +0100 Subject: [PATCH] Log connection status --- src/peer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/peer.cpp b/src/peer.cpp index 9da2e07..0151038 100644 --- a/src/peer.cpp +++ b/src/peer.cpp @@ -524,7 +524,7 @@ void Peer::_waitCall(int id, std::condition_variable &cv, bool &hasreturned, con bool Peer::waitConnection(int s) { if (status_ == NodeStatus::kConnected) return true; - else if (status_ != NodeStatus::kConnecting) return false; + else if (status_ == NodeStatus::kDisconnected) return false; std::mutex m; std::unique_lock<std::mutex> lk(m); @@ -538,6 +538,7 @@ bool Peer::waitConnection(int s) { }); cv.wait_for(lk, seconds(s), [this]() { return status_ == NodeStatus::kConnected;}); + if (status_ != NodeStatus::kConnected) LOG(ERROR) << "NOT CONNECTED: " << int(status_); return status_ == NodeStatus::kConnected; } -- GitLab