/// <summary> /// Adds an input to this transaction that imports value from the given output. Note that this input is NOT /// complete and after every input is added with addInput() and every output is added with addOutput(), /// signInputs() must be called to finalize the transaction and finish the inputs off. Otherwise it won't be /// accepted by the network. /// </summary> public void AddInput(TransactionOutput from) { AddInput(new TransactionInput(Params, this, from)); }
/// <summary> /// Adds the given output to this transaction. The output must be completely initialized. /// </summary> public void AddOutput(TransactionOutput to) { to.ParentTransaction = this; _outputs.Add(to); }
/// <summary> /// Creates an UNSIGNED input that links to the given output /// </summary> internal TransactionInput(NetworkParameters @params, Transaction parentTransaction, TransactionOutput output) : base(@params) { var outputIndex = output.Index; Outpoint = new TransactionOutPoint(@params, outputIndex, output.ParentTransaction); ScriptBytes = EmptyArray; _sequence = uint.MaxValue; ParentTransaction = parentTransaction; }