Fix checkpoint exchange to support rolling upgrades, fixed silent lag startup period, Mixed v4.12/v4.13 peers coexist
This commit is contained in:
@@ -3188,6 +3188,13 @@ bool P2PServer::P2PClient::on_checkpoint_request()
|
||||
LOGINFO(4, "peer " << log::Gray() << static_cast<char*>(m_addrString) << log::NoColor()
|
||||
<< " requested checkpoints, sending " << checkpoints.size() << " checkpoints");
|
||||
|
||||
// If we have no checkpoints, don't send a response (backward compatibility)
|
||||
// Older peers expect count >= 1, so sending count=0 would cause them to disconnect
|
||||
if (checkpoints.empty()) {
|
||||
LOGINFO(4, "No checkpoints to send to peer " << static_cast<char*>(m_addrString) << ", skipping response");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Send checkpoint response
|
||||
const bool result = server->send(this,
|
||||
[&checkpoints, this](uint8_t* buf, size_t buf_size) -> size_t
|
||||
|
||||
Reference in New Issue
Block a user