Exemple #1
0
        public virtual void Read(Stream s)
        {
            BinaryReader br = new BinaryReader(s);

            version     = br.ReadUInt32();
            prev_block  = br.ReadBytes(32);
            merkle_root = br.ReadBytes(32);
            timestamp   = br.ReadUInt32();
            bits        = br.ReadUInt32();
            nonce       = br.ReadUInt32();
            txns        = new Transaction[VarInt.FromStream(s)];
            for (int i = 0; i < txns.Length; i++)
            {
                txns[i] = Transaction.FromStream(s);
            }
        }
Exemple #2
0
        public void Read(Stream s)
        {
            BinaryReader br = new BinaryReader(s);

            version = br.ReadUInt32();
            inputs  = new TxIn[VarInt.FromStream(s)];
            for (int i = 0; i < inputs.Length; i++)
            {
                inputs[i] = TxIn.FromStream(s);
            }
            outputs = new TxOut[VarInt.FromStream(s)];
            for (int i = 0; i < outputs.Length; i++)
            {
                outputs[i] = TxOut.FromStream(s);
            }
            lock_time = br.ReadUInt32();
        }
Exemple #3
0
 public static VarInt FromStream(Stream s)
 {
     VarInt x = new VarInt(0);
     x.Read(s);
     return x;
 }