Skip to content

Commit c999689

Browse files
committed
added processing initial tick to cfg that override node initial tick
1 parent 98a622a commit c999689

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func run() error {
5555
ProcessTickTimeout time.Duration `conf:"default:5s"`
5656
DisableTransactionStatusAddon bool `conf:"default:false"`
5757
ArbitratorIdentity string `conf:"default:AFZPUAIYVPNUYGJRQVLUKOPPVLHAZQTGLYAAUUNBXFTVTAMSBKQBLEIEPCVJ"`
58+
InitialTick uint32 `conf:"default:0"` // Initial tick to start processing from, 0 means disabled
5859
}
5960
Store struct {
6061
ResetEmptyTickKeys bool `conf:"default:false"`
@@ -184,7 +185,7 @@ func run() error {
184185
return errors.Wrapf(err, "getting arbitrator public key from [%s]", cfg.Qubic.ArbitratorIdentity)
185186
}
186187

187-
proc := processor.NewProcessor(p, ps, cfg.Qubic.ProcessTickTimeout, arbitratorPubKey, cfg.Qubic.DisableTransactionStatusAddon)
188+
proc := processor.NewProcessor(p, ps, cfg.Qubic.ProcessTickTimeout, arbitratorPubKey, cfg.Qubic.DisableTransactionStatusAddon, cfg.Qubic.InitialTick)
188189
procErrors := make(chan error, 1)
189190

190191
// Start the service listening for requests.

processor/processor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ type Processor struct {
3030
ps *store.PebbleStore
3131
arbitratorPubKey [32]byte
3232
processTickTimeout time.Duration
33+
initialTick uint32
3334
disableStatusAddon bool
3435
}
3536

36-
func NewProcessor(p *qubic.Pool, ps *store.PebbleStore, processTickTimeout time.Duration, arbitratorPubKey [32]byte, disableStatusAddon bool) *Processor {
37+
func NewProcessor(p *qubic.Pool, ps *store.PebbleStore, processTickTimeout time.Duration, arbitratorPubKey [32]byte, disableStatusAddon bool, initialTick uint32) *Processor {
3738
return &Processor{
3839
pool: p,
3940
ps: ps,
4041
processTickTimeout: processTickTimeout,
4142
arbitratorPubKey: arbitratorPubKey,
4243
disableStatusAddon: disableStatusAddon,
44+
initialTick: initialTick,
4345
}
4446
}
4547

@@ -82,6 +84,9 @@ func (p *Processor) processOneByOne() error {
8284
if err != nil {
8385
return errors.Wrap(err, "getting tick info")
8486
}
87+
if p.initialTick != 0 {
88+
tickInfo.InitialTick = p.initialTick
89+
}
8590

8691
lastTick, err := p.getLastProcessedTick(ctx, tickInfo)
8792
if err != nil {

0 commit comments

Comments
 (0)