internal static byte[] CreateOutputScript(Address to) { using (var bits = new MemoryStream()) { // TODO: Do this by creating a Script *first* then having the script reassemble itself into bytes. bits.Write(OpDup); bits.Write(OpHash160); WriteBytes(bits, to.Hash160); bits.Write(OpEqualVerify); bits.Write(OpCheckSig); return bits.ToArray(); } }
internal TransactionOutput(NetworkParameters @params, Transaction parent, ulong value, Address to) : base(@params) { _value = value; _scriptBytes = Script.CreateOutputScript(to); ParentTransaction = parent; _availableForSpending = true; }