diff options
author | xiphon <xiphon@protonmail.com> | 2019-02-25 01:31:45 +0000 |
---|---|---|
committer | xiphon <xiphon@protonmail.com> | 2019-02-25 03:22:14 +0000 |
commit | a54e81e57213aa6a983401b20c3e150550a6e948 (patch) | |
tree | fd0abbc73494e0ad5f503529184d49ec4c803ca6 /src/cryptonote_protocol/cryptonote_protocol_handler.inl | |
parent | Merge pull request #4988 (diff) | |
download | monero-a54e81e57213aa6a983401b20c3e150550a6e948.tar.xz |
daemon: add '--no-sync' arg to optionally disable blockchain sync
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.inl')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 10 |
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 c1459cbb6..310d475e5 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) @@ -374,6 +375,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"); |