コード例 #1
0
        //Add a transaction to the block
        public Boolean AddTransaction(BlockTransaction _Transaction)
        {
            Boolean ret = true;

            try
            {
                blockTransactions.Add(_Transaction);
            }
            catch
            {
                Console.WriteLine("Something went wrong when adding the transaction to the block");
                ret = false;
            }

            return(ret);
        }
コード例 #2
0
        public Boolean AddTransactionToBlock(BlockChain _chain, BlockTransaction _transAction)
        {
            TargetBlock = _chain.GetBlock(_transAction.blockHeight);

            if (TargetBlock == null)
            {
                throw new InvalidOperationException("Block you want to add the transaction to does not exist on the chain");
            }

            if (!_transAction.isSigned)
            {
                throw new InvalidOperationException("Transaction is not signed, cannot be added to the chain");
            }

            TargetBlock.AddTransaction(this);

            return(true);
        }
コード例 #3
0
 public void AddTransactionToChainCue(BlockTransaction _transAction)
 {
     unconfirmedTransactions.Add(_transAction);
 }