Use GetBlockTime() more

int64_t is preferred over unsigned int for time calculations when possible.