|
|
@@ -288,9 +288,9 @@ func (bc *BlockChain) loadLastState() error {
|
|
|
blockTd := bc.GetTd(currentBlock.Hash(), currentBlock.NumberU64())
|
|
|
fastTd := bc.GetTd(currentFastBlock.Hash(), currentFastBlock.NumberU64())
|
|
|
|
|
|
- log.Info("Loaded most recent local header", "number", currentHeader.Number, "hash", currentHeader.Hash(), "td", headerTd, "age", common.PrettyAge(time.Unix(currentHeader.Time.Int64(), 0)))
|
|
|
- log.Info("Loaded most recent local full block", "number", currentBlock.Number(), "hash", currentBlock.Hash(), "td", blockTd, "age", common.PrettyAge(time.Unix(currentBlock.Time().Int64(), 0)))
|
|
|
- log.Info("Loaded most recent local fast block", "number", currentFastBlock.Number(), "hash", currentFastBlock.Hash(), "td", fastTd, "age", common.PrettyAge(time.Unix(currentFastBlock.Time().Int64(), 0)))
|
|
|
+ log.Info("Loaded most recent local header", "number", currentHeader.Number, "hash", currentHeader.Hash(), "td", headerTd, "age", common.PrettyAge(time.Unix(int64(currentHeader.Time), 0)))
|
|
|
+ log.Info("Loaded most recent local full block", "number", currentBlock.Number(), "hash", currentBlock.Hash(), "td", blockTd, "age", common.PrettyAge(time.Unix(int64(currentBlock.Time()), 0)))
|
|
|
+ log.Info("Loaded most recent local fast block", "number", currentFastBlock.Number(), "hash", currentFastBlock.Hash(), "td", fastTd, "age", common.PrettyAge(time.Unix(int64(currentFastBlock.Time()), 0)))
|
|
|
|
|
|
return nil
|
|
|
}
|
|
|
@@ -904,7 +904,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
|
|
|
|
|
|
context := []interface{}{
|
|
|
"count", stats.processed, "elapsed", common.PrettyDuration(time.Since(start)),
|
|
|
- "number", head.Number(), "hash", head.Hash(), "age", common.PrettyAge(time.Unix(head.Time().Int64(), 0)),
|
|
|
+ "number", head.Number(), "hash", head.Hash(), "age", common.PrettyAge(time.Unix(int64(head.Time()), 0)),
|
|
|
"size", common.StorageSize(bytes),
|
|
|
}
|
|
|
if stats.ignored > 0 {
|
|
|
@@ -1074,8 +1074,8 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
|
|
|
// accepted for future processing, and returns an error if the block is too far
|
|
|
// ahead and was not added.
|
|
|
func (bc *BlockChain) addFutureBlock(block *types.Block) error {
|
|
|
- max := big.NewInt(time.Now().Unix() + maxTimeFutureBlocks)
|
|
|
- if block.Time().Cmp(max) > 0 {
|
|
|
+ max := uint64(time.Now().Unix() + maxTimeFutureBlocks)
|
|
|
+ if block.Time() > max {
|
|
|
return fmt.Errorf("future block timestamp %v > allowed %v", block.Time(), max)
|
|
|
}
|
|
|
bc.futureBlocks.Add(block.Hash(), block)
|