3 using System.Collections.Generic;
8 /// Transaction output.
15 private ulong nValue = 0;
18 /// Second half of script which contains spending instructions.
20 private byte[] scriptPubKey;
26 public IList<byte> ToBytes()
28 List<byte> resultBytes = new List<byte>();
30 resultBytes.AddRange(Interop.LEBytes(nValue)); // txout value
31 resultBytes.AddRange(VarInt.EncodeVarInt(scriptPubKey.LongLength)); // scriptPubKey length
32 resultBytes.AddRange(scriptPubKey); // scriptPubKey
37 public override string ToString ()
39 StringBuilder sb = new StringBuilder ();
40 sb.AppendFormat ("CTxOut(nValue={0},scriptPubKey={1}", nValue, scriptPubKey.ToString());
42 return sb.ToString ();