public TxIn(TxOutpoint outpoint, byte[] script, uint sequence) { Contract.Requires <ArgumentNullException>(outpoint != null, "outpoint"); Contract.Requires <ArgumentNullException>(script != null, "script"); Outpoint = outpoint; ScriptLength = (ulong)script.LongLength; _script = (byte[])script.Clone(); Sequence = sequence; ByteSize = Outpoint.ByteSize + ScriptLength.ByteSize + (uint)ScriptLength.Value * BufferOperations.UINT8_SIZE + Sequence.ByteSize(); }
public TxIn(TxOutpoint outpoint, byte[] script, uint sequence) { Contract.Requires<ArgumentNullException>(outpoint != null, "outpoint"); Contract.Requires<ArgumentNullException>(script != null, "script"); Outpoint = outpoint; ScriptLength = (ulong)script.LongLength; _script = (byte[])script.Clone(); Sequence = sequence; ByteSize = Outpoint.ByteSize + ScriptLength.ByteSize + (uint)ScriptLength.Value * BufferOperations.UINT8_SIZE + Sequence.ByteSize(); }
public TxIn(byte[] buffer, int offset) : base(buffer, offset) { Contract.Requires<ArgumentNullException>(buffer != null, "buffer"); Contract.Requires<ArgumentException>(buffer.Length >= TxIn.MinimumByteSize, "buffer"); Contract.Requires<ArgumentOutOfRangeException>(offset >= 0, "offset"); Contract.Requires<ArgumentOutOfRangeException>(offset <= buffer.Length - TxIn.MinimumByteSize, "offset"); Outpoint = new TxOutpoint(buffer, offset); ScriptLength = new VarInt(buffer, offset + SCRIPTLEN_OFFSET); var script = new byte[ScriptLength]; Array.Copy(buffer, offset + SCRIPTLEN_OFFSET + (int)ScriptLength.ByteSize, script, 0, (int)ScriptLength.Value); _script = script; Sequence = buffer.ReadUInt32(offset + SCRIPTLEN_OFFSET + (int)ScriptLength.ByteSize + (int)ScriptLength.Value * BufferOperations.UINT8_SIZE); ByteSize = Outpoint.ByteSize + ScriptLength.ByteSize + (uint)ScriptLength.Value * BufferOperations.UINT8_SIZE + Sequence.ByteSize(); }
public TxIn(byte[] buffer, int offset) : base(buffer, offset) { Contract.Requires <ArgumentNullException>(buffer != null, "buffer"); Contract.Requires <ArgumentException>(buffer.Length >= TxIn.MinimumByteSize, "buffer"); Contract.Requires <ArgumentOutOfRangeException>(offset >= 0, "offset"); Contract.Requires <ArgumentOutOfRangeException>(offset <= buffer.Length - TxIn.MinimumByteSize, "offset"); Outpoint = new TxOutpoint(buffer, offset); ScriptLength = new VarInt(buffer, offset + SCRIPTLEN_OFFSET); var script = new byte[ScriptLength]; Array.Copy(buffer, offset + SCRIPTLEN_OFFSET + (int)ScriptLength.ByteSize, script, 0, (int)ScriptLength.Value); _script = script; Sequence = buffer.ReadUInt32(offset + SCRIPTLEN_OFFSET + (int)ScriptLength.ByteSize + (int)ScriptLength.Value * BufferOperations.UINT8_SIZE); ByteSize = Outpoint.ByteSize + ScriptLength.ByteSize + (uint)ScriptLength.Value * BufferOperations.UINT8_SIZE + Sequence.ByteSize(); }