Class Transaction
java.lang.Object
com.bradyrussell.uiscoin.transaction.Transaction
- All Implemented Interfaces:
SerializableAsBinaryData
,VerifiableWithBlockchain
public class Transaction extends java.lang.Object implements SerializableAsBinaryData, VerifiableWithBlockchain
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<TransactionInput>
Inputs
java.util.ArrayList<TransactionOutput>
Outputs
long
TimeStamp
int
Version
-
Constructor Summary
Constructors Constructor Description Transaction()
Transaction(int version, long timeStamp)
Transaction(int version, long timeStamp, java.util.ArrayList<TransactionInput> inputs, java.util.ArrayList<TransactionOutput> outputs)
-
Method Summary
Modifier and Type Method Description Transaction
addInput(TransactionInput Input)
Transaction
addOutput(TransactionOutput Output)
void
debugVerify(BlockchainStorage blockchain)
void
debugVerifyCoinbase(BlockchainStorage blockchain, int BlockHeight)
boolean
equals(java.lang.Object o)
byte[]
getBinaryData()
long
getFees(BlockchainStorage blockchain)
byte[]
getHash()
long
getInputTotal(BlockchainStorage blockchain)
long
getOutputTotal()
int
getSize()
int
setBinaryData(byte[] Data)
boolean
verify(BlockchainStorage blockchain)
boolean
verifyCoinbase(BlockchainStorage blockchain, int BlockHeight)
boolean
verifyInputsUnspent(BlockchainStorage blockchain)
-
Field Details
-
Constructor Details
-
Transaction
public Transaction() -
Transaction
public Transaction(int version, long timeStamp) -
Transaction
public Transaction(int version, long timeStamp, java.util.ArrayList<TransactionInput> inputs, java.util.ArrayList<TransactionOutput> outputs)
-
-
Method Details
-
addInput
-
addOutput
-
getBinaryData
public byte[] getBinaryData()- Specified by:
getBinaryData
in interfaceSerializableAsBinaryData
-
setBinaryData
public int setBinaryData(byte[] Data)- Specified by:
setBinaryData
in interfaceSerializableAsBinaryData
-
getSize
public int getSize()- Specified by:
getSize
in interfaceSerializableAsBinaryData
-
getHash
public byte[] getHash()- Specified by:
getHash
in interfaceSerializableAsBinaryData
-
verifyCoinbase
-
debugVerify
public void debugVerify(BlockchainStorage blockchain) throws NoSuchTransactionException, NoSuchBlockException -
debugVerifyCoinbase
-
verifyInputsUnspent
- Throws:
NoSuchTransactionException
-
getInputTotal
public long getInputTotal(BlockchainStorage blockchain) throws NoSuchTransactionException, NoSuchBlockException -
getOutputTotal
public long getOutputTotal() -
getFees
public long getFees(BlockchainStorage blockchain) throws NoSuchTransactionException, NoSuchBlockException -
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
verify
- Specified by:
verify
in interfaceVerifiableWithBlockchain
-