Widen arg types for Transaction.getInput and getOutput so they can be fed the result of TransactionOutPoint.getIndex() directly.

This commit is contained in:
Mike Hearn
2014-12-04 17:50:37 +01:00
parent 757e25ba9b
commit d438caaece

View File

@@ -1114,17 +1114,19 @@ public class Transaction extends ChildMessage implements Serializable {
Collections.shuffle(outputs); Collections.shuffle(outputs);
} }
/** @return the given transaction: same as getInputs().get(index). */ /** Same as getInputs().get(index). */
public TransactionInput getInput(int index) { public TransactionInput getInput(long index) {
maybeParse(); 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(); 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() { public synchronized TransactionConfidence getConfidence() {
if (confidence == null) { if (confidence == null) {
confidence = new TransactionConfidence(getHash()); confidence = new TransactionConfidence(getHash());