// Checks the transaction timestamp for validity in being included in the current block. // No node has any responsiblity to forward on transactions that do not fall within // the timeframe around a block defined by TRANSACTION_PRIOR_LIMIT and TRANSACTION_POST_LIMIT func (fs *FactoidState) ValidateTransactionAge(trans fct.ITransaction) error { tsblk := fs.GetCurrentBlock().GetCoinbaseTimestamp() if tsblk < 0 { return fmt.Errorf("Block has no coinbase transaction at this time") } tstrans := int64(trans.GetMilliTimestamp()) if tsblk-tstrans > fct.TRANSACTION_PRIOR_LIMIT { return fmt.Errorf("Transaction is too old to be included in the current block") } if tstrans-tsblk > fct.TRANSACTION_POST_LIMIT { return fmt.Errorf("Transaction is dated too far in the future to be included in the current block") } return nil }