예제 #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;
        }
예제 #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);
        }
예제 #3
0
 public void AddOutput(TransactionOutput output)
 {
     mOutputs.Add(output);
 }
예제 #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;
        }
예제 #5
0
 public void AddOutput(TransactionOutput output)
 {
     mOutputs.Add(output);
 }