Dynamic roundtime detection. (#244)

When consensus is unreliable detect roundtime based on roundtime reported by peers.
This commit is contained in:
Ravin Perera
2021-02-16 13:34:29 +05:30
committed by GitHub
parent 4c4e109233
commit 9f4499653a
19 changed files with 430 additions and 241 deletions

View File

@@ -109,6 +109,9 @@ namespace p2p
return -1;
}
// Remember the roundtime reported by this peer.
session.reported_roundtime = chall.roundtime;
// Sending the challenge response to the sender.
flatbuffers::FlatBufferBuilder fbuf(1024);
p2pmsg::create_peer_challenge_response_from_challenge(fbuf, chall.challenge);
@@ -153,13 +156,9 @@ namespace p2p
const p2pmsg::Peer_Requirement_Announcement_Message *announcement_msg = content->message_as_Peer_Requirement_Announcement_Message();
session.need_consensus_msg_forwarding = announcement_msg->need_consensus_msg_forwarding();
if (session.need_consensus_msg_forwarding)
{
LOG_DEBUG << "Consensus message forwaring is required for " << session.display_name();
}
else
{
LOG_DEBUG << "Consensus message forwaring is not required for " << session.display_name();
}
}
else if (content_message_type == p2pmsg::Message_Proposal_Message) // message is a proposal message
{