transactions

package
v0.0.0-...-acf744c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TXNotFoundErrorUnspent = "inunspent"
View Source
const TXPrepareNoFundsError = "noenoughfunds"
View Source
const TXSQLBaseDifferentError = "sqlbaseisdifferent"
View Source
const TXVerifyErrorNoInput = "noinput"

Variables

This section is empty.

Functions

func NewTXNoEnoughFundsdError

func NewTXNoEnoughFundsdError(err string) error

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

func NewTXVerifySQLBaseError

func NewTXVerifySQLBaseError(err 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 TXPrepareError

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

func (*TXPrepareError) Error

func (e *TXPrepareError) Error() string

func (*TXPrepareError) ErrorOrig

func (e *TXPrepareError) ErrorOrig() string

func (*TXPrepareError) GetKind

func (e *TXPrepareError) 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

func (TXVerifyError) IsKind

func (e TXVerifyError) IsKind(kind string) bool

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) (remoteclient.WalletBalance, error)
	GetUnapprovedCount() (int, error)
	GetUnspentCount() (int, error)
	GetUnapprovedTransactionsForNewBlock(number int) ([]structures.Transaction, error)
	// Returns list of transactions from the pool. Filters by time or maxcount, it total is lexx maxcount, returns all
	GetUnapprovedTransactionsFiltered(minCreateTime int64, maxCount int, ignoreTransactions [][]byte) ([][]byte, error)
	GetIfExists(txid []byte) (*structures.Transaction, error)
	GetIfUnapprovedExists(txid []byte) (*structures.Transaction, error)

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

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

	// Create transaction methods
	CreateCurrencyTransaction(PubKey []byte, privKey ecdsa.PrivateKey, to string, amount float64) (*structures.Transaction, error)
	PrepareNewCurrencyTransaction(PubKey []byte, to string, amount float64) ([]byte, []byte, error)
	AddNewTransaction(tx *structures.Transaction, flags int) error
	PrepareNewSQLTransaction(PubKey []byte, sqlUpdate structures.SQLUpdate, amount float64, to string) ([]byte, []byte, error)
	PrepareSQLTransactionSignatureData(tx *structures.Transaction) (txBytes []byte, datatosign []byte, err 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, sqlrollbacktoexecute bool) 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