aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/data_logger.cpp
diff options
context:
space:
mode:
authorrfree2monero <rfreemonero@op.pl>2015-02-24 21:02:48 +0100
committerrfree2monero <rfreemonero@op.pl>2015-02-24 21:06:02 +0100
commitf79821ac7ebc269b18dd2edd8ac0cb022861ad11 (patch)
treee7e1d625b0b1bfb2a6b9aea73f5a8115b55fca5e /src/p2p/data_logger.cpp
parent2014 network limit 1.3 fix log/path/data +utils (diff)
downloadmonero-f79821ac7ebc269b18dd2edd8ac0cb022861ad11.tar.xz
fix locking in count-peers thread (2)
Diffstat (limited to 'src/p2p/data_logger.cpp')
-rw-r--r--src/p2p/data_logger.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/p2p/data_logger.cpp b/src/p2p/data_logger.cpp
index d62af133e..69e50141a 100644
--- a/src/p2p/data_logger.cpp
+++ b/src/p2p/data_logger.cpp
@@ -20,6 +20,12 @@ namespace net_utils
m_state = data_logger_state::state_ready_to_use;
}
);
+
+ if (m_state != data_logger_state::state_ready_to_use) {
+ _erro ("trying to use not working data_logger");
+ throw std::runtime_error("data_logger ctor state");
+ }
+
return * m_obj;
}
@@ -82,7 +88,7 @@ namespace net_utils
}
void data_logger::kill_instance() {
- m_state = m_state = data_logger_state::state_dying;
+ m_state = data_logger_state::state_dying;
m_obj.reset();
}