OSDN Git Service

update
authorChengcheng Zhang <943420582@qq.com>
Wed, 5 Jun 2019 02:38:21 +0000 (10:38 +0800)
committerChengcheng Zhang <943420582@qq.com>
Wed, 5 Jun 2019 02:38:21 +0000 (10:38 +0800)
proposal/blockproposer/blockproposer.go

index caa8b2b..96c78bb 100644 (file)
@@ -58,7 +58,7 @@ func (b *BlockProposer) generateBlocks() {
                if now < bestBlockHeader.Timestamp {
                        base = bestBlockHeader.Timestamp
                }
-               minTimeToNextBlock := consensus.BlockTimeInterval - now%consensus.BlockTimeInterval
+               minTimeToNextBlock := consensus.BlockTimeInterval - base%consensus.BlockTimeInterval
                nextBlockTime := base + minTimeToNextBlock
                if (nextBlockTime - now) < consensus.BlockTimeInterval/10 {
                        nextBlockTime += consensus.BlockTimeInterval