3 using System.Collections.Generic;
13 /// Hash of parent transaction.
15 private Hash256 txID = new Hash256();
18 /// Parent input number.
20 private uint nInput = 0;
23 /// First half of script, signatures for the scriptPubKey
25 private byte[] scriptSig;
28 /// Transaction variant number, irrelevant if nLockTime isn't specified. Its value is 0xffffffff by default.
30 private uint nSequence = 0xffffffff;
36 public IList<byte> ToBytes()
38 List<byte> inputBytes = new List<byte>();
41 inputBytes.AddRange(txID.hashBytes); // Input transaction id
42 inputBytes.AddRange(Interop.LEBytes(nInput)); // Input number
43 inputBytes.AddRange(VarInt.EncodeVarInt(scriptSig.LongLength)); // Scriptsig length
44 inputBytes.AddRange(scriptSig); // ScriptSig
45 inputBytes.AddRange(Interop.LEBytes(nSequence)); // Sequence
50 public override string ToString ()
52 StringBuilder sb = new StringBuilder ();
53 sb.AppendFormat ("CTxIn(txId={0},n={1},scriptSig={2}", nInput, nInput, scriptSig.ToString());
55 return sb.ToString ();