Documentation
¶
Index ¶
- Variables
- type Config
- type TransactionCache
- func (c *TransactionCache) CleanSignedTransactions(trxs []transaction.Transaction)
- func (c *TransactionCache) ReadAwaitingTransactionsByIssuer(address string) ([]transaction.Transaction, error)
- func (c *TransactionCache) ReadAwaitingTransactionsByReceiver(address string) ([]transaction.Transaction, error)
- func (c *TransactionCache) WriteIssuerSignedTransactionForReceiver(trx *transaction.Transaction) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpected = errors.New("unexpected error") ErrNotAllowReoccurringHash = errors.New("not allowed reoccurring hash") )
Functions ¶
This section is empty.
Types ¶
type TransactionCache ¶
type TransactionCache struct {
// contains filtered or unexported fields
}
TransactionCache is designed to store data in parallel with repository.
func NewTransactionCache ¶
func NewTransactionCache(cfg Config) *TransactionCache
NewTransactionCache creates a new TransactionCache according to Config.
func (*TransactionCache) CleanSignedTransactions ¶
func (c *TransactionCache) CleanSignedTransactions(trxs []transaction.Transaction)
CleanSignedTransactions removes all the transactions with given hashes from the cache.
func (*TransactionCache) ReadAwaitingTransactionsByIssuer ¶
func (c *TransactionCache) ReadAwaitingTransactionsByIssuer(address string) ([]transaction.Transaction, error)
ReadAwaitingTransactionsByIssuer reads transaction belonging to the issuer if exists in the cache.
func (*TransactionCache) ReadAwaitingTransactionsByReceiver ¶
func (c *TransactionCache) ReadAwaitingTransactionsByReceiver(address string) ([]transaction.Transaction, error)
ReadAwaitingTransactionsByReceiver reads transaction belongint to the receiver if exists in the cache.
func (*TransactionCache) WriteIssuerSignedTransactionForReceiver ¶
func (c *TransactionCache) WriteIssuerSignedTransactionForReceiver(trx *transaction.Transaction) error
WriteIssuerSignedTransactionForReceiver writes transaction to cache if cache has enough space.
Click to show internal directories.
Click to hide internal directories.