Skip to content

Commit

Permalink
bugfix: stop etx collection in prime after finding prime block in sam…
Browse files Browse the repository at this point in the history
…e region
  • Loading branch information
gameofpointers committed May 8, 2023
1 parent 50fd2e0 commit fe53495
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
c_maxPendingEtxBatches = 256
c_maxPendingEtxBatches = 1024
c_maxPendingEtxsRollup = 256
c_pendingHeaderCacheLimit = 100
c_pendingHeaderChacheBufferFactor = 2
Expand Down Expand Up @@ -336,8 +336,9 @@ func (sl *Slice) CollectNewlyConfirmedEtxs(block *types.Block, location common.L
if ancestor == nil {
return nil, nil, fmt.Errorf("unable to find ancestor, hash: %s", ancHash.String())
}
// Terminate the search when we find a block produced by the given location
if ancestor.Location().Equal(location) {

// Terminate the search when we find a block produced by the same sub
if ancestor.Location().SubIndex() == location.SubIndex() {
return newlyConfirmedEtxs, subRollup, nil
}

Expand Down

0 comments on commit fe53495

Please sign in to comment.