quiet the messages

This commit is contained in:
Cassandra Heart 2024-03-14 23:40:52 -05:00
parent 1b11e07095
commit ebd7f723c6
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -30,6 +30,11 @@ func (e *CeremonyDataClockConsensusEngine) runMessageHandler() {
continue
}
e.peerMapMx.RLock()
peer, ok := e.peerMap[string(message.From)]
e.peerMapMx.RUnlock()
if ok && bytes.Compare(peer.version, config.GetMinimumVersion()) >= 0 {
for name := range e.executionEngines {
name := name
go func() error {
@ -75,6 +80,7 @@ func (e *CeremonyDataClockConsensusEngine) runMessageHandler() {
return nil
}()
}
}
any := &anypb.Any{}
if err := proto.Unmarshal(msg.Payload, any); err != nil {
@ -84,12 +90,12 @@ func (e *CeremonyDataClockConsensusEngine) runMessageHandler() {
go func() {
switch any.TypeUrl {
case protobufs.ClockFrameType:
e.peerMapMx.RLock()
if peer, ok := e.peerMap[string(message.From)]; !ok ||
bytes.Compare(peer.version, config.GetMinimumVersion()) < 0 {
if !ok || bytes.Compare(
peer.version,
config.GetMinimumVersion(),
) < 0 {
return
}
e.peerMapMx.RUnlock()
if err := e.handleClockFrameData(
message.From,
msg.Address,