Skip to content

Commit

Permalink
streamline getShouldSendMessageFromDecider flow
Browse files Browse the repository at this point in the history
addresses review comment ava-labs/awm-relayer#344 (comment)
  • Loading branch information
feuGeneA committed Jul 25, 2024
1 parent 24ea347 commit 017c157
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions messages/teleporter/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,25 +183,24 @@ func (m *messageHandler) ShouldSendMessage(destinationClient vms.DestinationClie
return false, nil
}

if decision, err := m.getShouldSendMessageFromDecider(); err != nil {
decision, err := m.getShouldSendMessageFromDecider()
if err != nil {
m.logger.Warn(
"Error delegating to decider",
zap.String("warpMessageID", m.unsignedMessage.ID().String()),
zap.String("teleporterMessageID", teleporterMessageID.String()),
)
} else {
if !decision {
m.logger.Info(
"Decider rejected message",
zap.String("warpMessageID", m.unsignedMessage.ID().String()),
zap.String("teleporterMessageID", teleporterMessageID.String()),
zap.String("destinationBlockchainID", destinationBlockchainID.String()),
)
}
return decision, nil
return true, nil
}

return true, nil
if !decision {
m.logger.Info(
"Decider rejected message",
zap.String("warpMessageID", m.unsignedMessage.ID().String()),
zap.String("teleporterMessageID", teleporterMessageID.String()),
zap.String("destinationBlockchainID", destinationBlockchainID.String()),
)
}
return decision, nil
}

// Queries the decider service to determine whether this message should be
Expand Down

0 comments on commit 017c157

Please sign in to comment.