Beispiel #1
0
        public void ReadFromPayload(byte[] data, int offset)
        {
            Value        = BitConverter.ToUInt64(data, offset);
            ScriptLength = new VarInt(0);
            ScriptLength.ReadFromPayload(data, offset + 8);

            Script = new byte[ScriptLength];
            Buffer.BlockCopy(data, offset + 8 + ScriptLength.Size, Script, 0, Script.Length);
        }
Beispiel #2
0
        public void ReadFromPayload(byte[] data, int offset)
        {
            Previous = new Outpoint();
            Previous.ReadFromPayload(data, offset);

            ScriptLength = new VarInt(0);
            ScriptLength.ReadFromPayload(data, offset + Previous.Size);

            Script = new byte[ScriptLength];
            Buffer.BlockCopy(data, offset + Previous.Size, Script, 0, ScriptLength);

            Sequence = BitConverter.ToUInt32(data, offset + Previous.Size + ScriptLength);
        }
Beispiel #3
0
        public void ReadFromPayload(byte[] data, int offset)
        {
            Size      = 8;
            Version   = BitConverter.ToUInt32(data, offset);
            TxInCount = new VarInt(0);
            TxInCount.ReadFromPayload(data, offset + 4);

            TxIn = new TxIn[TxInCount];

            int txInOffset = offset + 4 + TxInCount.Size;

            for (var x = 0; x < TxInCount; x++)
            {
                var tx = new TxIn();
                tx.ReadFromPayload(data, txInOffset);

                TxIn[x] = tx;

                txInOffset += tx.Size;
                Size       += tx.Size;
            }

            TxOutCount = new VarInt(0);
            TxOutCount.ReadFromPayload(data, txInOffset);

            TxOut = new TxOut[TxOutCount];

            int txOutOffset = txInOffset + TxOutCount.Size;

            for (var x = 0; x < TxOutCount; x++)
            {
                var tx = new TxOut();
                tx.ReadFromPayload(data, txOutOffset);

                TxOut[x] = tx;

                txOutOffset += tx.Size;
                Size        += tx.Size;
            }

            LockTime = BitConverter.ToUInt32(data, txOutOffset);
            Size    += TxInCount.Size + TxOutCount.Size;
        }