Skip to content

Commit

Permalink
Make the header timestamp respect time of generation (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Aug 10, 2022
1 parent e14e52a commit e977be7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions consensus/ibft/consensus_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,7 @@ func (i *backendIBFT) buildBlock(snap *Snapshot, parent *types.Header) (*types.B
}

// set the timestamp
parentTime := time.Unix(int64(parent.Timestamp), 0)
headerTime := parentTime.Add(i.blockTime)

if headerTime.Before(time.Now()) {
headerTime = time.Now()
}

header.Timestamp = uint64(headerTime.Unix())
header.Timestamp = uint64(time.Now().Unix())

// we need to include in the extra field the current set of validators
putIbftExtraValidators(header, snap.Set)
Expand Down

0 comments on commit e977be7

Please sign in to comment.