aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp10
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
index 137dbacfc..3bda50c22 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
@@ -49,8 +49,8 @@
#include "syncobj.h"
-#include "../../contrib/epee/include/net/net_utils_base.h"
-#include "../../contrib/epee/include/misc_log_ex.h"
+#include "net/net_utils_base.h"
+#include "misc_log_ex.h"
#include <boost/lambda/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/uuid/random_generator.hpp>
@@ -69,10 +69,10 @@
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/ip/unicast.hpp>
-#include "../../src/cryptonote_protocol/cryptonote_protocol_handler.h"
-#include "../../src/p2p/network_throttle.hpp"
+#include "cryptonote_protocol_handler.h"
+#include "p2p/network_throttle.hpp"
-#include "../../../src/cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal()
+#include "cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal()
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.cn"
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 9dcc8901a..4652bf23e 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -41,7 +41,7 @@
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "profile_tools.h"
-#include "../../src/p2p/network_throttle-detail.hpp"
+#include "p2p/network_throttle-detail.hpp"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.cn"
@@ -212,7 +212,7 @@ namespace cryptonote
cnx.recv_idle_time = timestamp - cntxt.m_last_recv;
cnx.send_count = cntxt.m_send_cnt;
- cnx.send_idle_time = timestamp;
+ cnx.send_idle_time = timestamp - cntxt.m_last_send;
cnx.state = get_protocol_state_string(cntxt.m_state);
@@ -276,7 +276,7 @@ namespace cryptonote
m_core.set_target_blockchain_height(static_cast<int64_t>(hshd.current_height));
int64_t diff = static_cast<int64_t>(hshd.current_height) - static_cast<int64_t>(m_core.get_current_blockchain_height());
int64_t max_block_height = max(static_cast<int64_t>(hshd.current_height),static_cast<int64_t>(m_core.get_current_blockchain_height()));
- int64_t last_block_v1 = 1009826;
+ int64_t last_block_v1 = m_core.get_testnet() ? 624633 : 1009826;
int64_t diff_v2 = max_block_height > last_block_v1 ? min(abs(diff), max_block_height - last_block_v1) : 0;
MCLOG(is_inital ? el::Level::Info : el::Level::Debug, "global", context << "Sync data returned a new top block candidate: " << m_core.get_current_blockchain_height() << " -> " << hshd.current_height
<< " [Your node is " << std::abs(diff) << " blocks (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "