/** * Same as {@link #addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)} * but defaults to {@link SigHash#ALL} and "false" for the anyoneCanPay flag. This is normally what you want. */ public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey) throws ScriptException { return addSignedInput(prevOut, scriptPubKey, sigKey, SigHash.ALL, false); }
/** * Same as {@link #addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)} * but defaults to {@link SigHash#ALL} and "false" for the anyoneCanPay flag. This is normally what you want. */ public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey) throws ScriptException { return addSignedInput(prevOut, scriptPubKey, sigKey, SigHash.ALL, false); }
/** * Same as {@link #addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)} * but defaults to {@link SigHash#ALL} and "false" for the anyoneCanPay flag. This is normally what you want. */ public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey) throws ScriptException { return addSignedInput(prevOut, scriptPubKey, sigKey, SigHash.ALL, false); }
/** * Same as {@link #addSignedInput(TransactionOutPoint, org.bitcoinj.script.Script, ECKey, org.bitcoinj.core.Transaction.SigHash, boolean)} * but defaults to {@link SigHash#ALL} and "false" for the anyoneCanPay flag. This is normally what you want. */ public TransactionInput addSignedInput(TransactionOutPoint prevOut, Script scriptPubKey, ECKey sigKey) throws ScriptException { return addSignedInput(prevOut, scriptPubKey, sigKey, SigHash.ALL, false); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput( TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey, SigHash sigHash, boolean anyoneCanPay) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey, sigHash, anyoneCanPay); }
/** * Adds an input that points to the given output and contains a valid signature for it, calculated using the * signing key. */ public TransactionInput addSignedInput(TransactionOutput output, ECKey signingKey) { return addSignedInput(output.getOutPointFor(), output.getScriptPubKey(), signingKey); }
(null == dltTransaction.getChangeAddress()) ? fromAddress : dltTransaction.getChangeAddress())); TransactionOutPoint transactionOutPoint = new TransactionOutPoint(this.networkParameters, inputUtxo.getIndex(), inputUtxo.getHash()); transaction.addSignedInput(transactionOutPoint, inputUtxo.getScript(), this.key, Transaction.SigHash.ALL, true); transaction.getConfidence().setSource(TransactionConfidence.Source.SELF); transaction.setPurpose(Transaction.Purpose.USER_PAYMENT);
tx.addSignedInput(it, fromKey);
@Test(expected = ScriptException.class) public void testAddSignedInputThrowsExceptionWhenScriptIsNotToRawPubKeyAndIsNotToAddress() { ECKey key = new ECKey(); Address addr = key.toAddress(PARAMS); Transaction fakeTx = FakeTxBuilder.createFakeTx(PARAMS, Coin.COIN, addr); Transaction tx = new Transaction(PARAMS); tx.addOutput(fakeTx.getOutput(0)); Script script = ScriptBuilder.createOpReturnScript(new byte[0]); tx.addSignedInput(fakeTx.getOutput(0).getOutPointFor(), script, key); }
t.addSignedInput(spendableOutput, new Script(spendableOutputScriptPubKey), outKey); rollingBlock.addTransaction(t); rollingBlock.solve();
t.addSignedInput(spendableOutput, new Script(spendableOutputScriptPubKey), outKey); rollingBlock.addTransaction(t); rollingBlock.solve();
t.addSignedInput(spendableOutput, new Script(spendableOutputScriptPubKey), outKey); rollingBlock.addTransaction(t); rollingBlock.solve();