Beispiel #1
0
        bool IsReferencedCoinbaseTxsValid(TransactionContext dbTx, TransactionValidation.PointedTransaction ptx)
        {
            var currentHeight = Tip == null ? 0 : Tip.Value.header.blockNumber;

            foreach (var refTx in ptx.pInputs.Select(t => t.Item1.txHash))
            {
                Types.BlockHeader refTxBk;
                if (BlockStore.IsCoinbaseTx(dbTx, refTx, out refTxBk))
                {
                    if (refTxBk.blockNumber - currentHeight < COINBASE_MATURITY)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }