diff --git a/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java b/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java index bdb4ddfa7..0f24f3f69 100644 --- a/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java +++ b/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java @@ -231,7 +231,7 @@ public class BitcoinSerializer extends MessageSerializer { } else if (command.equals("getheaders")) { return new GetHeadersMessage(payload); } else if (command.equals("tx")) { - return makeTransaction(payload, hash); + return makeTransaction(payload); } else if (command.equals("sendaddrv2")) { check(!payload.hasRemaining(), ProtocolException::new); return new SendAddrV2Message(); @@ -333,7 +333,7 @@ public class BitcoinSerializer extends MessageSerializer { * serialization format support. */ @Override - public Transaction makeTransaction(ByteBuffer payload, byte[] hashFromHeader) + public Transaction makeTransaction(ByteBuffer payload) throws ProtocolException { return new Transaction(payload, this); } diff --git a/core/src/main/java/org/bitcoinj/core/DummySerializer.java b/core/src/main/java/org/bitcoinj/core/DummySerializer.java index e10fbe2b0..4a6365d33 100644 --- a/core/src/main/java/org/bitcoinj/core/DummySerializer.java +++ b/core/src/main/java/org/bitcoinj/core/DummySerializer.java @@ -96,7 +96,7 @@ class DummySerializer extends MessageSerializer { } @Override - public Transaction makeTransaction(ByteBuffer payload, byte[] hash) throws UnsupportedOperationException { + public Transaction makeTransaction(ByteBuffer payload) throws UnsupportedOperationException { throw new UnsupportedOperationException(DEFAULT_EXCEPTION_MESSAGE); } diff --git a/core/src/main/java/org/bitcoinj/core/MessageSerializer.java b/core/src/main/java/org/bitcoinj/core/MessageSerializer.java index 4150ffd6b..713f114d3 100644 --- a/core/src/main/java/org/bitcoinj/core/MessageSerializer.java +++ b/core/src/main/java/org/bitcoinj/core/MessageSerializer.java @@ -101,20 +101,7 @@ public abstract class MessageSerializer { * serializer (i.e. for messages with no network parameters), or because * it does not support deserializing transactions. */ - public abstract Transaction makeTransaction(ByteBuffer payload, byte[] hash) throws ProtocolException, UnsupportedOperationException; - - /** - * Make a transaction from the payload. Extension point for alternative - * serialization format support. - * - * @throws UnsupportedOperationException if this serializer/deserializer - * does not support deserialization. This can occur either because it's a dummy - * serializer (i.e. for messages with no network parameters), or because - * it does not support deserializing transactions. - */ - public final Transaction makeTransaction(ByteBuffer payload) throws ProtocolException { - return makeTransaction(payload, null); - } + public abstract Transaction makeTransaction(ByteBuffer payload) throws ProtocolException, UnsupportedOperationException; public abstract void seekPastMagicBytes(ByteBuffer in) throws BufferUnderflowException;