cache

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxEntityPrefix = "txm_entity_" // txm_entity_blocknumber_txhash_logIndex,不用hash结构,避免不同用户数据在同一个key的情况
	TxEntityTtl    = 864000
)
View Source
const (
	FillOwnerPrefix = "txm_fill_owner_"
	FillOwnerTtl    = 864000 // todo 临时数据,只存储10分钟,系统性宕机后无法重启后丢失?
)
View Source
const (
	MaxNoncePrefix          = "txm_nonce_max_"
	MaxNonceTxSuccessPrefix = "txm_nonce_txsuccess_"
	NonceTtl                = 86400 // todo 临时数据,只存储10分钟,系统性宕机后无法重启后丢失?
)

Variables

This section is empty.

Functions

func ExistFillOwnerCache

func ExistFillOwnerCache(txhash common.Hash, owner common.Address) (bool, error)

func GetMaxNonceValue

func GetMaxNonceValue(owner common.Address) (*big.Int, error)

/////////////////////////////////////////////////////////

nonce, tx status is success/pending/failed

/////////////////////////////////////////////////////////

func GetTxMinedMaxNonceValue

func GetTxMinedMaxNonceValue(owner common.Address) (*big.Int, error)

/////////////////////////////////////////////////////////

nonce, tx status is success

/////////////////////////////////////////////////////////

func Initialize

func Initialize(db *dao.RdsService)

func Invalid

func Invalid() bool

func RollbackEntityCache

func RollbackEntityCache(from, to int64) error

func SetFillOwnerCache

func SetFillOwnerCache(txhash common.Hash, owner common.Address) error

func SetMaxNonceValue

func SetMaxNonceValue(owner common.Address, preNonce, currentNonce *big.Int) error

func SetTxMinedMaxNonceValue

func SetTxMinedMaxNonceValue(owner common.Address, preNonce, currentNonce *big.Int) error

Types

type TransactionEntityMap

type TransactionEntityMap map[string]map[int64]dao.TransactionEntity

func GetEntityCache

func GetEntityCache(views []dao.TransactionView) TransactionEntityMap

根据transactionView数据批量获取缓存

func (TransactionEntityMap) GetEntity

func (m TransactionEntityMap) GetEntity(txhash string, logindex int64) (dao.TransactionEntity, bool)

func (TransactionEntityMap) SaveEntity

func (m TransactionEntityMap) SaveEntity(entity dao.TransactionEntity)

Jump to

Keyboard shortcuts

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