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.
parent
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, 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(OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(Object o) |
ECKey |
getConnectedKey(KeyBag keyBag)
Returns the ECKey identified in the connected output, for either pay-to-address scripts or pay-to-key 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 pay-to-address scripts, pay-to-key
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) |
String |
toString() |
adjustLength, adjustLength, setParent, unCache
bitcoinSerialize, bitcoinSerialize, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unsafeBitcoinSerialize
public 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
ProtocolException
public 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.ProtocolException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException
Message
bitcoinSerializeToStream
in class Message
IOException
@Nullable public TransactionOutput getConnectedOutput()
public byte[] getConnectedPubKeyScript()
NullPointerException
- if there is no connected output.@Nullable public ECKey getConnectedKey(KeyBag keyBag) throws ScriptException
getConnectedRedeemData(org.bitcoinj.wallet.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
ScriptException
public Sha256Hash getHash()
public long getIndex()
public void setIndex(long index)
Copyright © 2016. All rights reserved.