From d438caaece84e9bfb84eac24a9a888f3e4011578 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 4 Dec 2014 17:50:37 +0100 Subject: [PATCH] Widen arg types for Transaction.getInput and getOutput so they can be fed the result of TransactionOutPoint.getIndex() directly. --- .../src/main/java/org/bitcoinj/core/Transaction.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/bitcoinj/core/Transaction.java b/core/src/main/java/org/bitcoinj/core/Transaction.java index 9b793993..3f586b39 100644 --- a/core/src/main/java/org/bitcoinj/core/Transaction.java +++ b/core/src/main/java/org/bitcoinj/core/Transaction.java @@ -1114,17 +1114,19 @@ public class Transaction extends ChildMessage implements Serializable { Collections.shuffle(outputs); } - /** @return the given transaction: same as getInputs().get(index). */ - public TransactionInput getInput(int index) { + /** Same as getInputs().get(index). */ + public TransactionInput getInput(long index) { maybeParse(); - return inputs.get(index); + return inputs.get((int)index); } - public TransactionOutput getOutput(int index) { + /** Same as getOutputs().get(index) */ + public TransactionOutput getOutput(long index) { maybeParse(); - return outputs.get(index); + return outputs.get((int)index); } + /** Returns the confidence object that is owned by this transaction object. */ public synchronized TransactionConfidence getConfidence() { if (confidence == null) { confidence = new TransactionConfidence(getHash());