mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 09:50:32 +01:00
MessageSerializer: remove variant makeTransaction(payload, hash)
This commit is contained in:
parent
1346504fb0
commit
414bcf8b6c
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user