Skip to content

Commit

Permalink
Merge pull request #246 from flow-hydraulics/latenssi/admin-proposal-…
Browse files Browse the repository at this point in the history
…key-check

Fix logic in CheckAdminProposalKeyCount
  • Loading branch information
latenssi authored Dec 21, 2021
2 parents f9517ff + 6767dce commit a530817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keys/basic/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (s *KeyManager) CheckAdminProposalKeyCount(ctx context.Context) error {
}
}

if onChainCount != int(s.cfg.AdminProposalKeyCount) {
if onChainCount < int(s.cfg.AdminProposalKeyCount) {
return fmt.Errorf(
"configured: %d, onchain: %d, %w",
s.cfg.AdminProposalKeyCount,
Expand All @@ -89,7 +89,7 @@ func (s *KeyManager) CheckAdminProposalKeyCount(ctx context.Context) error {

if inDBCount, err := s.store.ProposalKeyCount(); err != nil {
return fmt.Errorf("error while fetching admin proposal key count from database: %w", err)
} else if inDBCount != int64(s.cfg.AdminProposalKeyCount) {
} else if inDBCount < int64(s.cfg.AdminProposalKeyCount) {
return fmt.Errorf(
"configured: %d, in database: %d, %w",
s.cfg.AdminProposalKeyCount,
Expand Down

0 comments on commit a530817

Please sign in to comment.