From 1b4fa9669149bed986f07775a62d3a3f7c5c4afe Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 14 Feb 2013 15:35:11 +0100 Subject: [PATCH] Make the last TransactionInput c'tor public, it can be used to build coinbase transactions. Updates issue 312. --- .../main/java/com/google/bitcoin/core/TransactionInput.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/core/TransactionInput.java b/core/src/main/java/com/google/bitcoin/core/TransactionInput.java index b4c66039..0e19fb92 100644 --- a/core/src/main/java/com/google/bitcoin/core/TransactionInput.java +++ b/core/src/main/java/com/google/bitcoin/core/TransactionInput.java @@ -54,15 +54,14 @@ public class TransactionInput extends ChildMessage implements Serializable { private Transaction parentTransaction; /** - * Used only in creation of the genesis block. + * Creates an input that connects to nothing - used only in creation of coinbase transactions. */ - TransactionInput(NetworkParameters params, Transaction parentTransaction, byte[] scriptBytes) { + public TransactionInput(NetworkParameters params, Transaction parentTransaction, byte[] scriptBytes) { super(params); this.scriptBytes = scriptBytes; this.outpoint = new TransactionOutPoint(params, NO_SEQUENCE, (Transaction)null); this.sequence = NO_SEQUENCE; this.parentTransaction = parentTransaction; - length = 40 + (scriptBytes == null ? 1 : VarInt.sizeOf(scriptBytes.length) + scriptBytes.length); }