aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/validator.go
diff options
context:
space:
mode:
Diffstat (limited to 'simulation/validator.go')
-rw-r--r--simulation/validator.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/simulation/validator.go b/simulation/validator.go
index 6ce5fa7..27e02fb 100644
--- a/simulation/validator.go
+++ b/simulation/validator.go
@@ -124,6 +124,12 @@ func (v *Validator) MsgServer() {
}
}
+func (v *Validator) createBlockTimestamps() map[types.ValidatorID]time.Time {
+ timestamps := make(map[types.ValidatorID]time.Time)
+ timestamps[v.GetID()] = time.Now()
+ return timestamps
+}
+
// BroadcastGenesisBlock broadcasts genesis block to all peers.
func (v *Validator) BroadcastGenesisBlock() {
// Wait until all peer joined the network.
@@ -138,6 +144,7 @@ func (v *Validator) BroadcastGenesisBlock() {
ParentHash: hash,
Hash: hash,
Height: 0,
+ Timestamps: v.createBlockTimestamps(),
Acks: map[common.Hash]struct{}{},
}
v.genesis = b
@@ -171,6 +178,7 @@ ProposingBlockLoop:
ParentHash: v.current.Hash,
Hash: common.NewRandomHash(),
Height: v.current.Height + 1.,
+ Timestamps: v.createBlockTimestamps(),
Acks: map[common.Hash]struct{}{},
}
v.current = block