Exemplo n.º 1
0
        /* ********************************************************************************
        * Functions
        * ****************************************************************************** */
        #region "Functions"

        /// <summary>
        /// Load the contents of a stream into this structure.
        /// </summary>
        /// <param name="streamReference">Reference to the (predefined) stream.</param>
        public void Read(Stream streamReference)
        {
            BinaryReader _binaryReader = new BinaryReader(streamReference);

            this.value        = _binaryReader.ReadUInt64();
            this.scriptPubKey = _binaryReader.ReadBytes(VarInt.FromStream(streamReference).intValue);
        }
Exemplo n.º 2
0
        /* ********************************************************************************
        * Functions
        * ****************************************************************************** */
        #region "Functions"

        /// <summary>
        /// Load the contents of a stream into this structure.
        /// </summary>
        /// <param name="streamReference">Reference to the (predefined) stream.</param>
        public void Read(Stream streamReference)
        {
            BinaryReader _binaryReader = new BinaryReader(streamReference);

            this.prevOut      = _binaryReader.ReadBytes(32);
            this.prevOutIndex = _binaryReader.ReadUInt32();
            this.scriptSig    = _binaryReader.ReadBytes(VarInt.FromStream(streamReference).intValue);
            this.sequenceNo   = _binaryReader.ReadUInt32();
        }
Exemplo n.º 3
0
        /* ********************************************************************************
        * Functions
        * ****************************************************************************** */
        #region "Functions"

        /// <summary>
        /// Load the contents of a stream into this structure.
        /// </summary>
        /// <param name="streamReference">Reference to the (predefined) stream.</param>
        public virtual void Read(Stream streamReference)
        {
            BinaryReader _binaryReader = new BinaryReader(streamReference);

            this.version      = _binaryReader.ReadUInt32();
            this.prev_block   = _binaryReader.ReadBytes(32);
            this.merkle_root  = _binaryReader.ReadBytes(32);
            this.timestamp    = _binaryReader.ReadUInt32();
            this.bits         = _binaryReader.ReadUInt32();
            this.nonce        = _binaryReader.ReadUInt32();
            this.transactions = new Transaction[VarInt.FromStream(streamReference)];
            for (int i = 0; i < this.transactions.Length; i++)
            {
                this.transactions[i] = Transaction.FromStream(streamReference);
            }
        }
Exemplo n.º 4
0
        /* ********************************************************************************
        * Functions
        * ****************************************************************************** */
        #region "Functions"

        /// <summary>
        /// Load the contents of a stream into this structure.
        /// </summary>
        /// <param name="streamReference">Reference to the (predefined) stream.</param>
        public void Read(Stream streamReference)
        {
            BinaryReader _binaryReader = new BinaryReader(streamReference);

            this.version = _binaryReader.ReadUInt32();
            this.inputs  = new TxIn[VarInt.FromStream(streamReference)];
            for (int i = 0; i < this.inputs.Length; i++)
            {
                this.inputs[i] = TxIn.FromStream(streamReference);
            }
            this.outputs = new TxOut[VarInt.FromStream(streamReference)];
            for (int i = 0; i < this.outputs.Length; i++)
            {
                this.outputs[i] = TxOut.FromStream(streamReference);
            }
            this.lock_time = _binaryReader.ReadUInt32();
        }