fix unit test that failed travis

pull/1319/head
Dennis Won 5 years ago
parent b140f17b58
commit 8bd49d7736
  1. 4
      node/node.go

@ -257,7 +257,9 @@ func (node *Node) getTransactionsForNewBlock(coinbase common.Address) types.Tran
node.pendingTxMutex.Lock() node.pendingTxMutex.Lock()
// update recentTxsStats and initiailize for the new block // update recentTxsStats and initiailize for the new block
newBlockNum := node.Consensus.ChainReader.CurrentHeader().Number.Uint64() + 1
// the next block number to be added in consensus protocol, which is always one more than current chain header block
newBlockNum := node.Blockchain().CurrentBlock().NumberU64() + 1
for blockNum := range node.recentTxsStats { for blockNum := range node.recentTxsStats {
blockNumHourAgo := (time.Hour / time.Second) / node.BlockPeriod blockNumHourAgo := (time.Hour / time.Second) / node.BlockPeriod
if blockNum < node.Consensus.ChainReader.CurrentHeader().Number.Uint64()-uint64(blockNumHourAgo) { if blockNum < node.Consensus.ChainReader.CurrentHeader().Number.Uint64()-uint64(blockNumHourAgo) {

Loading…
Cancel
Save