Skip to content

Commit

Permalink
Merge branch 'develop' into release/txtracing/1.1.3-rc.2
Browse files Browse the repository at this point in the history
  • Loading branch information
uprendis committed Jul 28, 2023
2 parents cec5c1f + 2ef5800 commit 6bef95d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gossip/emitter/emitter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package emitter

import (
"errors"
"fmt"
"math/rand"
"os"
Expand All @@ -19,6 +20,7 @@ import (
"github.com/Fantom-foundation/go-opera/inter"
"github.com/Fantom-foundation/go-opera/logger"
"github.com/Fantom-foundation/go-opera/tracing"
"github.com/Fantom-foundation/go-opera/utils/errlock"
"github.com/Fantom-foundation/go-opera/utils/rate"
)

Expand Down Expand Up @@ -307,6 +309,12 @@ func (em *Emitter) createEvent(sortedTxs *types.TransactionsByPriceAndNonce) (*i
if !ok {
return nil, nil
}
prevEmitted := em.readLastEmittedEventID()
if prevEmitted != nil && prevEmitted.Epoch() >= em.epoch {
if selfParent == nil || *selfParent != *prevEmitted {
errlock.Permanent(errors.New("Local database is corrupted, which may lead to a doublesign"))
}
}

// Set parent-dependent fields
parentHeaders := make(inter.Events, len(parents))
Expand Down

0 comments on commit 6bef95d

Please sign in to comment.