From 88c80c980062eba3573a2210a07705853e1c2989 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Fri, 6 May 2016 10:27:04 +0200 Subject: [PATCH] Transaction: Rework JavaDoc of the addInput() variants. --- .../java/org/bitcoinj/core/Transaction.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index af4cd52d..e768acdd 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -22,6 +22,7 @@ import org.bitcoinj.crypto.TransactionSignature; import org.bitcoinj.script.Script; import org.bitcoinj.script.ScriptBuilder; import org.bitcoinj.script.ScriptOpCodes; +import org.bitcoinj.signers.TransactionSigner; import org.bitcoinj.utils.ExchangeRate; import org.bitcoinj.wallet.Wallet; import org.bitcoinj.wallet.WalletTransaction.Pool; @@ -747,16 +748,20 @@ public class Transaction extends ChildMessage { } /** - * 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. Returns the newly created input. + * 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 {@link #addInput()} and every output is added with + * {@link #addOutput()}, a {@link TransactionSigner} must be used to finalize the transaction and finish the inputs + * off. Otherwise it won't be accepted by the network. + * @return the newly created input. */ public TransactionInput addInput(TransactionOutput from) { return addInput(new TransactionInput(params, this, from)); } - /** Adds an input directly, with no checking that it's valid. Returns the new input. */ + /** + * Adds an input directly, with no checking that it's valid. + * @return the new input. + */ public TransactionInput addInput(TransactionInput input) { unCache(); input.setParent(this); @@ -765,7 +770,10 @@ public class Transaction extends ChildMessage { return input; } - /** Adds an input directly, with no checking that it's valid. Returns the new input. */ + /** + * Creates and adds an input to this transaction, with no checking that it's valid. + * @return the newly created input. + */ public TransactionInput addInput(Sha256Hash spendTxHash, long outputIndex, Script script) { return addInput(new TransactionInput(params, this, script.getProgram(), new TransactionOutPoint(params, outputIndex, spendTxHash))); }