Skip to content

Commit a11c287

Browse files
authored
Darren/fix/solo blocks with same timestamps (#1219)
1 parent e88bbb8 commit a11c287

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmd/thor/solo/core.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ func (c *Core) Pack(pendingTxs tx.Transactions, onDemand bool) ([]*tx.Transactio
6969
best := c.repo.BestBlockSummary()
7070
now := uint64(time.Now().Unix())
7171

72+
// If on-demand and now equals the best timestamp, this will create blocks with future timestamps
73+
// Otherwise, new blocks have the same timestamp as the best block
74+
if c.options.OnDemand {
75+
now = best.Header.Timestamp() + c.options.BlockInterval
76+
}
77+
7278
var txsToRemove []*tx.Transaction
7379

7480
if c.options.GasLimit == 0 {

0 commit comments

Comments
 (0)