aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go
index 580b65e1c..67779a63c 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/round-based-config.go
@@ -25,9 +25,11 @@ import (
type roundBasedConfig struct {
roundID uint64
+
// roundBeginTime is the beginning of round, as local time.
roundBeginTime time.Time
roundInterval time.Duration
+
// roundEndTime is a cache for begin + interval.
roundEndTime time.Time
}
@@ -43,8 +45,8 @@ func (config *roundBasedConfig) setRoundBeginTime(begin time.Time) {
config.roundEndTime = begin.Add(config.roundInterval)
}
-// isValidLastBlock checks if a block is a valid last block of this round.
-func (config *roundBasedConfig) isValidLastBlock(b *types.Block) bool {
+// isLastBlock checks if a block is the last block of this round.
+func (config *roundBasedConfig) isLastBlock(b *types.Block) bool {
return b.Position.Round == config.roundID &&
b.Timestamp.After(config.roundEndTime)
}