Exemple #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;
        }
Exemple #2
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);
        }
Exemple #3
0
 public void AddOutput(TransactionOutput output)
 {
     mOutputs.Add(output);
 }
Exemple #4
0
        public void Load(byte[] data)
        {
            mInputs = new List<TransactionInput>();
            mOutputs = new List<TransactionOutput>();

            MemoryStream stream = new MemoryStream(data);
            BinaryReader br = new BinaryReader(stream);

            mVersion = br.ReadUInt32();
            ulong inputs = Program.ReadVarInt(br);
            for (ulong i = 0; i < inputs; i++)
            {
                TransactionInput input = new TransactionInput(br);
                mInputs.Add(input);
            }

            ulong outputs = Program.ReadVarInt(br);
            for (ulong i = 0; i < outputs; i++)
            {
                TransactionOutput output = new TransactionOutput(br);
                mOutputs.Add(output);
            }

            mLockTime = br.ReadUInt32();

            br.Close();
            Status = DataStatus.Loaded;
        }
Exemple #5
0
 public void AddOutput(TransactionOutput output)
 {
     mOutputs.Add(output);
 }