Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions engine/collection/compliance/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ func (c *Core) OnBlockProposal(proposal flow.Slashable[*cluster.Proposal]) error
}

// ignore proposals that were already processed
_, err := c.headers.ByBlockID(blockID)
if err == nil {
exists, err := c.headers.Exists(blockID)
if err != nil {
return fmt.Errorf("could not check proposal: %w", err)
}
if exists {
log.Debug().Msg("skipping already processed proposal")
return nil
}
if !errors.Is(err, storage.ErrNotFound) {
return fmt.Errorf("could not check proposal: %w", err)
}

// there are two possibilities if the proposal is neither already pending
// processing in the cache, nor has already been processed:
Expand All @@ -202,7 +202,7 @@ func (c *Core) OnBlockProposal(proposal flow.Slashable[*cluster.Proposal]) error
// if the proposal is connected to a block that is neither in the cache, nor
// in persistent storage, its direct parent is missing; cache the proposal
// and request the parent
exists, err := c.headers.Exists(block.ParentID)
exists, err = c.headers.Exists(block.ParentID)
if err != nil {
return fmt.Errorf("could not check parent exists: %w", err)
}
Expand Down
Loading