P2PServer: tweaked invalid timestamp messages
This commit is contained in:
+8
-2
@@ -2083,9 +2083,15 @@ bool P2PServer::P2PClient::handle_incoming_block_async(const PoolBlock* block, u
|
||||
|
||||
if (failed) {
|
||||
if (is_new) {
|
||||
int64_t dt = static_cast<int64_t>(block->m_timestamp - t);
|
||||
char sign = '+';
|
||||
if (dt < 0) {
|
||||
sign = '-';
|
||||
dt = -dt;
|
||||
}
|
||||
LOGWARN(4, "peer " << static_cast<char*>(m_addrString)
|
||||
<< " sent a block " << block->m_sidechainId << " (mined by " << block->m_minerWallet << ") with an invalid timestamp " << block->m_timestamp
|
||||
<< " (your local timestamp is " << t << ")");
|
||||
<< " (" << sign << dt << " seconds)");
|
||||
|
||||
uint32_t failed_checks = 0;
|
||||
|
||||
@@ -2096,7 +2102,7 @@ bool P2PServer::P2PClient::handle_incoming_block_async(const PoolBlock* block, u
|
||||
}
|
||||
|
||||
if (failed_checks > 16) {
|
||||
LOGWARN(1, "Your system clock might be invalid: " << failed_checks << " of 32 last blocks were rejected due to timestamp difference");
|
||||
LOGWARN(1, "Your system clock might be invalid: " << failed_checks << " of 32 last blocks were rejected due to high timestamp diff");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user