transactions

package
v0.0.0-...-f7c9202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TXNotFoundErrorUnspent = "inunspent"
View Source
const TXVerifyErrorNoInput = "noinput"

Variables

This section is empty.

Functions

func NewTXNotFoundError

func NewTXNotFoundError(err string, kind string) error

func NewTXNotFoundUOTError

func NewTXNotFoundUOTError(err string) error

func NewTXVerifyError

func NewTXVerifyError(err string, kind string, TX []byte) error

Types

type TXNotFoundError

type TXNotFoundError struct {
	// contains filtered or unexported fields
}

func (*TXNotFoundError) Error

func (e *TXNotFoundError) Error() string

func (*TXNotFoundError) GetKind

func (e *TXNotFoundError) GetKind() string

type TXVerifyError

type TXVerifyError struct {
	TX []byte
	// contains filtered or unexported fields
}

func (*TXVerifyError) Error

func (e *TXVerifyError) Error() string

func (*TXVerifyError) GetKind

func (e *TXVerifyError) GetKind() string

type TransactionsIndexSpentOutputs

type TransactionsIndexSpentOutputs struct {
	OutInd      int
	TXWhereUsed []byte
	InInd       int
	BlockHash   []byte
}

func (TransactionsIndexSpentOutputs) String

func (tiso TransactionsIndexSpentOutputs) String() string

type TransactionsManagerInterface

type TransactionsManagerInterface interface {
	GetAddressBalance(address string) (wallet.WalletBalance, error)
	GetUnapprovedCount() (int, error)
	GetUnspentCount() (int, error)
	GetUnapprovedTransactionsForNewBlock(number int) ([]*structures.Transaction, error)
	GetIfExists(txid []byte) (*structures.Transaction, error)
	GetIfUnapprovedExists(txid []byte) (*structures.Transaction, error)

	VerifyTransaction(tx *structures.Transaction, prevtxs []*structures.Transaction, tip []byte) (bool, error)

	ForEachUnspentOutput(address string, callback UnspentTransactionOutputCallbackInterface) error
	ForEachUnapprovedTransaction(callback UnApprovedTransactionCallbackInterface) (int, error)

	// Create transaction methods
	CreateTransaction(PubKey []byte, privKey ecdsa.PrivateKey, to string, amount float64) (*structures.Transaction, error)
	ReceivedNewTransaction(tx *structures.Transaction) error
	ReceivedNewTransactionData(txBytes []byte, Signatures [][]byte) (*structures.Transaction, error)
	PrepareNewTransaction(PubKey []byte, to string, amount float64) ([]byte, [][]byte, error)

	// new block was created in blockchain DB. It must not be on top of primary blockchain
	BlockAdded(block *structures.Block, ontopofchain bool) error
	// block was removed from blockchain DB from top
	BlockRemoved(block *structures.Block) error
	// block was not in primary chain and now is
	BlockAddedToPrimaryChain(block *structures.Block) error
	// block was in primary chain and now is not
	BlockRemovedFromPrimaryChain(block *structures.Block) error

	CancelTransaction(txID []byte) error
	ReindexData() (map[string]int, error)
	CleanUnapprovedCache() error
}

type UnApprovedTransactionCallbackInterface

type UnApprovedTransactionCallbackInterface func(txhash, txstr string) error

type UnspentTransactionOutputCallbackInterface

type UnspentTransactionOutputCallbackInterface func(fromaddr string, value float64, txID []byte, output int, isbase bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL