com.google.bitcoin.core
Class StoredTransactionOutput

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

public class StoredTransactionOutput
extends Object
implements Serializable

A StoredTransactionOutput message contains the information necessary to check a spending transaction. It avoids having to store the entire parentTransaction just to get the hash and index. Its only really useful for MemoryFullPrunedBlockStore, and should probably be moved there

See Also:
Serialized Form

Constructor Summary
StoredTransactionOutput(InputStream in)
           
StoredTransactionOutput(Sha256Hash hash, long index, BigInteger value, int height, boolean isCoinbase, byte[] scriptBytes)
          Creates a stored transaction output
StoredTransactionOutput(Sha256Hash hash, TransactionOutput out, int height, boolean isCoinbase)
           
 
Method Summary
 boolean equals(Object o)
           
 Sha256Hash getHash()
          The hash of the transaction which holds this output
 int getHeight()
          Gets the height of the block that created this output (or -1 if this output was not created by a coinbase)
 long getIndex()
          The index of this output in the transaction which holds it
 byte[] getScriptBytes()
          The backing script bytes which can be turned into a Script object.
 BigInteger getValue()
          The value which this Transaction output holds
 int hashCode()
           
 void serializeToStream(OutputStream bos)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StoredTransactionOutput

public StoredTransactionOutput(Sha256Hash hash,
                               long index,
                               BigInteger value,
                               int height,
                               boolean isCoinbase,
                               byte[] scriptBytes)
Creates a stored transaction output

Parameters:
hash - the hash of the containing transaction
index - the outpoint
value - the value available
height - the height this output was created in
scriptBytes -

StoredTransactionOutput

public StoredTransactionOutput(Sha256Hash hash,
                               TransactionOutput out,
                               int height,
                               boolean isCoinbase)

StoredTransactionOutput

public StoredTransactionOutput(InputStream in)
                        throws IOException
Throws:
IOException
Method Detail

getValue

public BigInteger getValue()
The value which this Transaction output holds

Returns:
the value

getScriptBytes

public byte[] getScriptBytes()
The backing script bytes which can be turned into a Script object.

Returns:
the scriptBytes

getHash

public Sha256Hash getHash()
The hash of the transaction which holds this output

Returns:
the hash

getIndex

public long getIndex()
The index of this output in the transaction which holds it

Returns:
the index

getHeight

public int getHeight()
Gets the height of the block that created this output (or -1 if this output was not created by a coinbase)


toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

serializeToStream

public void serializeToStream(OutputStream bos)
                       throws IOException
Throws:
IOException


Copyright © 2014. All rights reserved.