Documentation
¶
Index ¶
- type TXInput
- type TXOutput
- type TXOutputs
- type Transaction
- func (tx *Transaction) Hash() []byte
- func (tx Transaction) IsCoinbase() bool
- func (tx Transaction) Serialize() []byte
- func (tx *Transaction) Sign(privKey ecdsa.PrivateKey, prevTXs map[string]Transaction)
- func (tx *Transaction) TrimmedCopy() Transaction
- func (tx *Transaction) Verify(prevTXs map[string]Transaction) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TXOutput ¶
TXOutput represents a transaction output
func NewTXOutput ¶
NewTXOutput create a new TXOutput
func (*TXOutput) IsLockedWithKey ¶
IsLockedWithKey checks if the output can be used by the owner of the pubkey
type TXOutputs ¶
type TXOutputs struct {
Outputs []TXOutput
}
TXOutputs collects TXOutput
func DeserializeOutputs ¶
DeserializeOutputs deserializes TXOutputs
type Transaction ¶
Transaction represents a Blockchain transaction
func NewCoinbaseTX ¶
func NewCoinbaseTX(to, data string) *Transaction
NewCoinbaseTX creates a new coinbase transaction
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() []byte
Hash returns the hash of the Transaction
func (Transaction) IsCoinbase ¶
func (tx Transaction) IsCoinbase() bool
IsCoinbase checks whether the transaction is coinbase
func (Transaction) Serialize ¶
func (tx Transaction) Serialize() []byte
Serialize returns a serialized Transaction
func (*Transaction) Sign ¶
func (tx *Transaction) Sign(privKey ecdsa.PrivateKey, prevTXs map[string]Transaction)
Sign signs each input of a Transaction
func (*Transaction) TrimmedCopy ¶
func (tx *Transaction) TrimmedCopy() Transaction
TrimmedCopy creates a trimmed copy of Transaction to be used in signing
func (*Transaction) Verify ¶
func (tx *Transaction) Verify(prevTXs map[string]Transaction) bool
Verify verifies signatures of Transaction inputs
Click to show internal directories.
Click to hide internal directories.