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; }
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); }
public void AddOutput(TransactionOutput output) { mOutputs.Add(output); }
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; }