Skip to content

Commit

Permalink
skip duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Feb 1, 2025
1 parent 98f6014 commit 9f55bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions state/protocol/badger/mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (m *FollowerState) headerExtend(ctx context.Context, candidate *flow.Block,
}
} else {
// parent is a block that has been received and certified by a QC.
err := transaction.WithTx(operation.IndexCertifiedBlockByView(parent.View, qc.BlockID))(tx)
err := transaction.WithTx(operation.SkipDuplicates(operation.IndexCertifiedBlockByView(parent.View, qc.BlockID)))(tx)
if err != nil {
return fmt.Errorf("could not index certified block: %w", err)
}
Expand Down Expand Up @@ -397,7 +397,7 @@ func (m *FollowerState) headerExtend(ctx context.Context, candidate *flow.Block,
}

// candidate is a block that has been received and certified by a QC
err := transaction.WithTx(operation.IndexCertifiedBlockByView(candidate.Header.View, blockID))(tx)
err := transaction.WithTx(operation.SkipDuplicates(operation.IndexCertifiedBlockByView(candidate.Header.View, blockID)))(tx)
if err != nil {
return fmt.Errorf("could not index certified block: %w", err)
}
Expand Down

0 comments on commit 9f55bdb

Please sign in to comment.