/** * Returns the connected transaction, assuming the input was connected with * {@link TransactionInput#connect(TransactionOutput)} or variants at some point. If it wasn't connected, then * this method returns null. */ @Nullable public Transaction getConnectedTransaction() { return getOutpoint().fromTx; }
/** * Returns the connected transaction, assuming the input was connected with * {@link TransactionInput#connect(TransactionOutput)} or variants at some point. If it wasn't connected, then * this method returns null. */ @Nullable public Transaction getConnectedTransaction() { return getOutpoint().fromTx; }
public void excludeOutputsSpentBy(Transaction tx) { for (TransactionInput input : tx.getInputs()) { spent.add(input.getOutpoint()); } }
/** * Alias for getOutpoint().getConnectedRedeemData(keyBag) * @see TransactionOutPoint#getConnectedRedeemData(org.bitcoinj.wallet.KeyBag) */ @Nullable public RedeemData getConnectedRedeemData(KeyBag keyBag) throws ScriptException { return getOutpoint().getConnectedRedeemData(keyBag); }
/** * Alias for getOutpoint().getConnectedRedeemData(keyBag) * @see TransactionOutPoint#getConnectedRedeemData(org.bitcoinj.wallet.KeyBag) */ @Nullable public RedeemData getConnectedRedeemData(KeyBag keyBag) throws ScriptException { return getOutpoint().getConnectedRedeemData(keyBag); }
public void excludeOutputsSpentBy(Transaction tx) { for (TransactionInput input : tx.getInputs()) { spent.add(input.getOutpoint()); } }
public void excludeOutputsSpentBy(Transaction tx) { for (TransactionInput input : tx.getInputs()) { spent.add(input.getOutpoint()); } }
/** * Returns the connected output, assuming the input was connected with * {@link TransactionInput#connect(TransactionOutput)} or variants at some point. If it wasn't connected, then * this method returns null. */ @Nullable public TransactionOutput getConnectedOutput() { return getOutpoint().getConnectedOutput(); }
public void excludeOutputsSpentBy(Transaction tx) { for (TransactionInput input : tx.getInputs()) { spent.add(input.getOutpoint()); } }
/** * Alias for getOutpoint().getConnectedRedeemData(keyBag) * @see TransactionOutPoint#getConnectedRedeemData(org.bitcoinj.wallet.KeyBag) */ @Nullable public RedeemData getConnectedRedeemData(KeyBag keyBag) throws ScriptException { return getOutpoint().getConnectedRedeemData(keyBag); }
/** * Returns the connected output, assuming the input was connected with * {@link TransactionInput#connect(TransactionOutput)} or variants at some point. If it wasn't connected, then * this method returns null. */ @Nullable public TransactionOutput getConnectedOutput() { return getOutpoint().getConnectedOutput(); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
/** * For a connected transaction, runs the script against the connected pubkey and verifies they are correct. * @throws ScriptException if the script did not verify. * @throws VerificationException If the outpoint doesn't match the given output. */ public void verify() throws VerificationException { final Transaction fromTx = getOutpoint().fromTx; long spendingIndex = getOutpoint().getIndex(); checkNotNull(fromTx, "Not connected"); final TransactionOutput output = fromTx.getOutput((int) spendingIndex); verify(output); }
@Override public int compare(TransactionInput o1, TransactionInput o2) { byte[] hash1 = o1.getOutpoint().getHash().getBytes(); byte[] hash2 = o2.getOutpoint().getHash().getBytes(); int hashCompare = LexicographicalComparator.getComparator().compare(hash1, hash2); if (hashCompare != 0) { return hashCompare; } else { return (int) (o1.getOutpoint().getIndex() - o2.getOutpoint().getIndex()); } } });
/** Finds whether txA spends txB */ boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
/** Finds whether txA spends txB */ boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
/** Finds whether txA spends txB */ boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
/** Finds whether txA spends txB */ boolean spends(Transaction txA, Transaction txB) { for (TransactionInput txInput : txA.getInputs()) { if (txInput.getOutpoint().getHash().equals(txB.getHash())) { return true; } } return false; }
/** Finds if tx is NOT spending other txns which are in the specified confidence type */ private boolean isNotSpendingTxnsInConfidenceType(Transaction tx, ConfidenceType confidenceType) { for (TransactionInput txInput : tx.getInputs()) { Transaction connectedTx = this.getTransaction(txInput.getOutpoint().getHash()); if (connectedTx != null && connectedTx.getConfidence().getConfidenceType().equals(confidenceType)) { return false; } } return true; }