public class TransactionOutPoint extends ChildMessage
This message is a reference or pointer to an output of a different transaction.
Instances of this class are not safe for use by multiple threads.
parentcursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH| Constructor and Description |
|---|
TransactionOutPoint(NetworkParameters params,
byte[] payload,
int offset)
/**
Deserializes the message.
|
TransactionOutPoint(NetworkParameters params,
byte[] payload,
int offset,
Message parent,
MessageSerializer serializer)
Deserializes the message.
|
TransactionOutPoint(NetworkParameters params,
long index,
Sha256Hash hash) |
TransactionOutPoint(NetworkParameters params,
long index,
Transaction fromTx) |
TransactionOutPoint(NetworkParameters params,
TransactionOutput connectedOutput) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(java.lang.Object o) |
ECKey |
getConnectedKey(KeyBag keyBag)
Returns the ECKey identified in the connected output, for either P2PKH, P2WPKH or P2PK scripts.
|
TransactionOutput |
getConnectedOutput()
An outpoint is a part of a transaction input that points to the output of another transaction.
|
byte[] |
getConnectedPubKeyScript()
Returns the pubkey script from the connected output.
|
RedeemData |
getConnectedRedeemData(KeyBag keyBag)
Returns the RedeemData identified in the connected output, for either P2PKH, P2WPKH, P2PK
or P2SH scripts.
|
Sha256Hash |
getHash()
Returns the hash of the transaction this outpoint references/spends/is connected to.
|
long |
getIndex() |
int |
hashCode() |
protected void |
parse() |
void |
setIndex(long index) |
java.lang.String |
toString() |
adjustLength, adjustLength, setParent, unCachebitcoinSerialize, bitcoinSerialize, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unsafeBitcoinSerializepublic TransactionOutPoint(NetworkParameters params, long index, @Nullable Transaction fromTx)
public TransactionOutPoint(NetworkParameters params, long index, Sha256Hash hash)
public TransactionOutPoint(NetworkParameters params, TransactionOutput connectedOutput)
public TransactionOutPoint(NetworkParameters params, byte[] payload, int offset) throws ProtocolException
ProtocolExceptionpublic TransactionOutPoint(NetworkParameters params, byte[] payload, int offset, Message parent, MessageSerializer serializer) throws ProtocolException
params - NetworkParameters object.offset - The location of the first payload byte within the array.serializer - the serializer to use for this message.ProtocolExceptionprotected void parse()
throws ProtocolException
parse in class MessageProtocolExceptionprotected void bitcoinSerializeToStream(java.io.OutputStream stream)
throws java.io.IOException
MessagebitcoinSerializeToStream in class Messagejava.io.IOException@Nullable public TransactionOutput getConnectedOutput()
public byte[] getConnectedPubKeyScript()
java.lang.NullPointerException - if there is no connected output.@Nullable public ECKey getConnectedKey(KeyBag keyBag) throws ScriptException
getConnectedRedeemData(KeyBag) and then get the
key from RedeemData.
If the script form cannot be understood, throws ScriptException.ScriptException@Nullable public RedeemData getConnectedRedeemData(KeyBag keyBag) throws ScriptException
ScriptExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic Sha256Hash getHash()
public long getIndex()
public void setIndex(long index)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object