Get status of transaction (Confirmation, Double spend)
Example #1
0
        public static TxStatus TxConfirmation(string TxHash)
        {
            if (string.IsNullOrWhiteSpace(TxHash.Trim()))
                throw new ArgumentException("Undefined or Null argument are not valid!", nameof(TxHash));

            var BApiEx = new Info.Blockchain.API.BlockExplorer.BlockExplorer();
            var tx = BApiEx.GetTransaction(TxHash);
            var LBtx = BApiEx.GetLatestBlock();

            var TxConf = new TxStatus((LBtx?.Height - tx?.BlockHeight + 1), tx.DoubleSpend);
            return TxConf;
        }
Example #2
0
        public static TxStatus TxConfirmation(string TxHash)
        {
            if (string.IsNullOrWhiteSpace(TxHash.Trim()))
            {
                throw new ArgumentException("Undefined or Null argument are not valid!", nameof(TxHash));
            }

            var BApiEx = new Info.Blockchain.API.BlockExplorer.BlockExplorer();
            var tx     = BApiEx.GetTransaction(TxHash);
            var LBtx   = BApiEx.GetLatestBlock();

            var TxConf = new TxStatus((LBtx?.Height - tx?.BlockHeight + 1), tx.DoubleSpend);

            return(TxConf);
        }