diff --git a/core/src/main/java/org/bitcoinj/core/TransactionInput.java b/core/src/main/java/org/bitcoinj/core/TransactionInput.java index a31697c0..cfe7027c 100644 --- a/core/src/main/java/org/bitcoinj/core/TransactionInput.java +++ b/core/src/main/java/org/bitcoinj/core/TransactionInput.java @@ -41,9 +41,12 @@ import static com.google.common.base.Preconditions.checkNotNull; * to the outputs of another. The exceptions are coinbase transactions, which create new coins. */ public class TransactionInput extends ChildMessage implements Serializable { + /** Magic sequence number that indicates there is no sequence number. */ public static final long NO_SEQUENCE = 0xFFFFFFFFL; private static final long serialVersionUID = 2; public static final byte[] EMPTY_ARRAY = new byte[0]; + // Magic outpoint index that indicates the input is in fact unconnected. + private static final long UNCONNECTED = 0xFFFFFFFFL; // Allows for altering transactions after they were broadcast. Tx replacement is currently disabled in the C++ // client so this is always the UINT_MAX. @@ -66,7 +69,7 @@ public class TransactionInput extends ChildMessage implements Serializable { * Creates an input that connects to nothing - used only in creation of coinbase transactions. */ public TransactionInput(NetworkParameters params, @Nullable Transaction parentTransaction, byte[] scriptBytes) { - this(params, parentTransaction, scriptBytes, new TransactionOutPoint(params, NO_SEQUENCE, (Transaction) null)); + this(params, parentTransaction, scriptBytes, new TransactionOutPoint(params, UNCONNECTED, (Transaction) null)); } public TransactionInput(NetworkParameters params, @Nullable Transaction parentTransaction, byte[] scriptBytes,