aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.inl
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-19 10:57:28 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-19 10:57:28 +0200
commitbf0f85221b748d2825fb6b169c8914ff17f40db7 (patch)
tree673fdd37ec752ae0f812f0678a631b4ecd77e4e6 /src/cryptonote_protocol/cryptonote_protocol_handler.inl
parentMerge pull request #4889 (diff)
parentdaemon: add '--no-sync' arg to optionally disable blockchain sync (diff)
downloadmonero-bf0f85221b748d2825fb6b169c8914ff17f40db7.tar.xz
Merge pull request #5195
a54e81e5 daemon: add '--no-sync' arg to optionally disable blockchain sync (xiphon)
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 2317aee84..b7ed34046 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -72,7 +72,8 @@ namespace cryptonote
m_p2p(p_net_layout),
m_syncronized_connections_count(0),
m_synchronized(offline),
- m_stopping(false)
+ m_stopping(false),
+ m_no_sync(false)
{
if(!m_p2p)
@@ -376,6 +377,13 @@ namespace cryptonote
m_core.set_target_blockchain_height((hshd.current_height));
}
MINFO(context << "Remote blockchain height: " << hshd.current_height << ", id: " << hshd.top_id);
+
+ if (m_no_sync)
+ {
+ context.m_state = cryptonote_connection_context::state_normal;
+ return true;
+ }
+
context.m_state = cryptonote_connection_context::state_synchronizing;
//let the socket to send response to handshake, but request callback, to let send request data after response
LOG_PRINT_CCONTEXT_L2("requesting callback");