com.google.bitcoin.core
Class TransactionOutput

java.lang.Object
  extended by com.google.bitcoin.core.Message
      extended by com.google.bitcoin.core.TransactionOutput
All Implemented Interfaces:
Serializable

public class TransactionOutput
extends Message
implements Serializable

A TransactionOutput message contains a scriptPubKey that controls who is able to spend its value. It is a sub-part of the Transaction message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.bitcoin.core.Message
bytes, cursor, MAX_SIZE, offset, params, protocolVersion
 
Constructor Summary
TransactionOutput(NetworkParameters params, Transaction parent, byte[] payload, int offset)
          Deserializes a transaction output message.
 
Method Summary
 void bitcoinSerializeToStream(OutputStream stream)
          Serializes this message to the provided stream.
 byte[] getScriptBytes()
           
 Script getScriptPubKey()
           
 BigInteger getValue()
          Returns the value of this output in nanocoins.
 boolean isMine(Wallet wallet)
          Returns true if this output is to an address we have the keys for in the wallet.
 String toString()
          Returns a human readable debug string.
 
Methods inherited from class com.google.bitcoin.core.Message
bitcoinSerialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionOutput

public TransactionOutput(NetworkParameters params,
                         Transaction parent,
                         byte[] payload,
                         int offset)
                  throws ProtocolException
Deserializes a transaction output message. This is usually part of a transaction message.

Throws:
ProtocolException
Method Detail

getScriptPubKey

public Script getScriptPubKey()
                       throws ScriptException
Throws:
ScriptException

bitcoinSerializeToStream

public void bitcoinSerializeToStream(OutputStream stream)
                              throws IOException
Description copied from class: Message
Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().

Throws:
IOException

getValue

public BigInteger getValue()
Returns the value of this output in nanocoins. This is the amount of currency that the destination address receives.


getScriptBytes

public byte[] getScriptBytes()

isMine

public boolean isMine(Wallet wallet)
Returns true if this output is to an address we have the keys for in the wallet.


toString

public String toString()
Returns a human readable debug string.

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.