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