From dd4d237cd9c34bdccc4dac4566bd786d288dcafd Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 12 Apr 2013 11:09:59 +0200 Subject: [PATCH] Allow modification of the inputs/outputs list. --- .../java/com/google/bitcoin/core/Transaction.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/Transaction.java b/core/src/main/java/com/google/bitcoin/core/Transaction.java index 5844557f..40d9f1f2 100644 --- a/core/src/main/java/com/google/bitcoin/core/Transaction.java +++ b/core/src/main/java/com/google/bitcoin/core/Transaction.java @@ -936,6 +936,7 @@ public class Transaction extends ChildMessage implements Serializable { */ public void setLockTime(long lockTime) { unCache(); + // TODO: Consider checking that at least one input has a non-final sequence number. this.lockTime = lockTime; } @@ -947,20 +948,16 @@ public class Transaction extends ChildMessage implements Serializable { return version; } - /** - * @return a read-only list of the inputs of this transaction. - */ + /** Returns a modifiable list of all inputs. */ public List getInputs() { maybeParse(); - return Collections.unmodifiableList(inputs); + return inputs; } - /** - * @return a read-only list of the outputs of this transaction. - */ + /** Returns a modifiable list of all outputs. */ public List getOutputs() { maybeParse(); - return Collections.unmodifiableList(outputs); + return outputs; } /** @return the given transaction: same as getInputs().get(index). */