File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package emitter
22
33import (
4+ "errors"
45 "fmt"
56 "math/rand"
67 "os"
@@ -19,6 +20,7 @@ import (
1920 "github.com/Fantom-foundation/go-opera/inter"
2021 "github.com/Fantom-foundation/go-opera/logger"
2122 "github.com/Fantom-foundation/go-opera/tracing"
23+ "github.com/Fantom-foundation/go-opera/utils/errlock"
2224 "github.com/Fantom-foundation/go-opera/utils/rate"
2325)
2426
@@ -307,6 +309,12 @@ func (em *Emitter) createEvent(sortedTxs *types.TransactionsByPriceAndNonce) (*i
307309 if ! ok {
308310 return nil , nil
309311 }
312+ prevEmitted := em .readLastEmittedEventID ()
313+ if prevEmitted != nil && prevEmitted .Epoch () >= em .epoch {
314+ if selfParent == nil || * selfParent != * prevEmitted {
315+ errlock .Permanent (errors .New ("Local database is corrupted, which may lead to a doublesign" ))
316+ }
317+ }
310318
311319 // Set parent-dependent fields
312320 parentHeaders := make (inter.Events , len (parents ))
You can’t perform that action at this time.
0 commit comments