code: func checkBlockHeaderSanity(header *wire.BlockHeader, powLimit *big.Int, timeSource MedianTimeSource, flags BehaviorFlags) error {
  	// Ensure the proof of work bits in the block header is in min/max range
  	// and the block hash is less than the target value described by the
  	// bits.
  	err := checkProofOfWork(header, powLimit, flags)
  	if err != nil {
  		return err
  	}
  
  	// A block timestamp must not have a greater precision than one second.
  	// This check is necessary because Go time.Time values support
  	// nanosecond precision whereas the consensus rules only apply to
  	// seconds and it's much nicer to deal with standard Go time values
  	// instead of converting to seconds everywhere.
  	if !header.Timestamp.Equal(time.Unix(header.Timestamp.Unix(), 0)) {
  		str := fmt.Sprintf("block timestamp of %v has a higher "+
  			"precision than one second", header.Timestamp)
  		return ruleError(ErrInvalidTime, str)
  	}
  
  	// Ensure the block time is not too far in the future.
  	maxTimestamp := timeSource.AdjustedTime().Add(time.Second *
  		MaxTimeOffsetSeconds)
  	if header.Timestamp.After(maxTimestamp) {
  		str := fmt.Sprintf("block timestamp of %v is too far in the "+
  			"future", header.Timestamp)
  		return ruleError(ErrTimeTooNew, str)
  	}
  
  	return nil
  }
docs: // checkBlockHeaderSanity performs some preliminary checks on a block header to
  // ensure it is sane before continuing with processing.  These checks are
  // context free.
  //
  // The flags do not modify the behavior of this function directly, however they
  // are needed to pass along to checkProofOfWork.