File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1332,6 +1332,20 @@ LOOP:
13321332 workList = append (workList , work )
13331333
13341334 delay := w .engine .Delay (w .chain , work .header , & w .config .DelayLeftOver )
1335+ if w .config .MB .LastBlockMiningTime > w .chainConfig .Parlia .Period * 1000 / 2 {
1336+ if p , ok := w .engine .(* parlia.Parlia ); ok {
1337+ service := p .APIs (w .chain )[0 ].Service
1338+ latestBlockNumber := rpc .LatestBlockNumber
1339+ currentTurnLength , err := service .(* parlia.API ).GetTurnLength (& latestBlockNumber )
1340+ if err == nil && (work .header .Number .Uint64 ()+ 1 )% uint64 (currentTurnLength ) == 0 {
1341+ * delay += time .Duration ((w .config .MB .LastBlockMiningTime - w .chainConfig .Parlia .Period * 1000 / 2 ) * uint64 (time .Millisecond ))
1342+ timeLeft := time .Until (time .Unix (int64 (work .header .Time ), 0 ))
1343+ if * delay > timeLeft {
1344+ * delay = timeLeft
1345+ }
1346+ }
1347+ }
1348+ }
13351349 if delay == nil {
13361350 log .Warn ("commitWork delay is nil, something is wrong" )
13371351 stopTimer = nil
You can’t perform that action at this time.
0 commit comments