code: func IsFinalizedTransaction(tx *btcutil.Tx, blockHeight int32, blockTime time.Time) bool {
  	msgTx := tx.MsgTx()
  
  	// Lock time of zero means the transaction is finalized.
  	lockTime := msgTx.LockTime
  	if lockTime == 0 {
  		return true
  	}
  
  	// The lock time field of a transaction is either a block height at
  	// which the transaction is finalized or a timestamp depending on if the
  	// value is before the txscript.LockTimeThreshold.  When it is under the
  	// threshold it is a block height.
  	blockTimeOrHeight := int64(0)
  	if lockTime < txscript.LockTimeThreshold {
  		blockTimeOrHeight = int64(blockHeight)
  	} else {
  		blockTimeOrHeight = blockTime.Unix()
  	}
  	if int64(lockTime) < blockTimeOrHeight {
  		return true
  	}
  
  	// At this point, the transaction's lock time hasn't occurred yet, but
  	// the transaction might still be finalized if the sequence number
  	// for all transaction inputs is maxed out.
  	for _, txIn := range msgTx.TxIn {
  		if txIn.Sequence != math.MaxUint32 {
  			return false
  		}
  	}
  	return true
  }
docs: // IsFinalizedTransaction determines whether or not a transaction is finalized.