aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-05-30 15:46:13 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-05-30 15:46:13 -0500
commita7ea14dc6a561069ca658a2c5343fbb7143996a9 (patch)
treef843d8fc50ec6394255d6b3bf8e60c6a65056eee /src/cryptonote_protocol
parent4267a0bb516ec2b35a8a47ba72f0d78adcd083d7 (diff)
parente942d34d5438eebf139f7dff686b285e78d04549 (diff)
downloadmonzero-core-a7ea14dc6a561069ca658a2c5343fbb7143996a9.tar.gz
monzero-core-a7ea14dc6a561069ca658a2c5343fbb7143996a9.tar.xz
monzero-core-a7ea14dc6a561069ca658a2c5343fbb7143996a9.zip
Merge pull request #3876
740da1b core: fix automatic safe db sync mode switching (moneromooo-monero) e942d34 protocol: do not switch to unsafe sync mode for just a few blocks (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 711605597..91c6c5d5e 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -308,7 +308,8 @@ namespace cryptonote
<< " [Your node is " << abs_diff << " blocks (" << ((abs_diff - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "
<< (0 <= diff ? std::string("behind") : std::string("ahead"))
<< "] " << ENDL << "SYNCHRONIZATION started");
- m_core.safesyncmode(false);
+ if (hshd.current_height >= m_core.get_current_blockchain_height() + 5) // don't switch to unsafe mode just for a few blocks
+ m_core.safesyncmode(false);
}
LOG_PRINT_L1("Remote blockchain height: " << hshd.current_height << ", id: " << hshd.top_id);
context.m_state = cryptonote_connection_context::state_synchronizing;