BitCoinClient.Block.AddTransaction C# (CSharp) Method

AddTransaction() public method

public AddTransaction ( Transaction tx ) : void
tx Transaction
return void
        public void AddTransaction(Transaction tx)
        {
            mTransactions.Add(tx);
        }

Usage Example

Example #1
0
        Block CreateBlock(Key key)
        {
            Block block = new Block();

            // Create transaction from nowhere to us!
            Transaction tx = new Transaction();
            TransactionInput input = new TransactionInput();
            TransactionOutput output = new TransactionOutput(key);
            tx.AddInput(input);
            tx.AddOutput(output);

            block.AddTransaction(tx);

            Transaction[] transactions = mBitcoin.GetTransactions();

            return block;
        }