Esempio n. 1
0
        private int GetBlocksToMaturity(WalletTx walletTx)
        {
            if (!(walletTx.Transaction.IsCoinBase || walletTx.Transaction.IsCoinStake))
            {
                return(0);
            }

            return(Math.Max(0, (this.coinbaseMaturity + 1) - this.GetDepthInMainChain(walletTx)));
        }
Esempio n. 2
0
        private int GetDepthInMainChain(WalletTx walletTx)
        {
            var chainedBlock = this.chainIndex.GetBlock(walletTx.Blokckid) ?? this.GetAheadMinedBlock(walletTx.Blokckid);

            if (chainedBlock == null)
            {
                return(0);
            }

            return(this.chainIndex.Tip.Height - chainedBlock.Height + 1);
        }