Documentation ¶
Index ¶
- Constants
- func ExistFillOwnerCache(txhash common.Hash, owner common.Address) (bool, error)
- func GetMaxNonceValue(owner common.Address) (*big.Int, error)
- func GetTxMinedMaxNonceValue(owner common.Address) (*big.Int, error)
- func Initialize(db *dao.RdsService)
- func Invalid() bool
- func RollbackEntityCache(from, to int64) error
- func SetFillOwnerCache(txhash common.Hash, owner common.Address) error
- func SetMaxNonceValue(owner common.Address, preNonce, currentNonce *big.Int) error
- func SetTxMinedMaxNonceValue(owner common.Address, preNonce, currentNonce *big.Int) error
- type TransactionEntityMap
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 GetMaxNonceValue ¶
/////////////////////////////////////////////////////////
nonce, tx status is success/pending/failed
/////////////////////////////////////////////////////////
func GetTxMinedMaxNonceValue ¶
/////////////////////////////////////////////////////////
nonce, tx status is success
/////////////////////////////////////////////////////////
func Initialize ¶
func Initialize(db *dao.RdsService)
func RollbackEntityCache ¶
func SetMaxNonceValue ¶
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)
Click to show internal directories.
Click to hide internal directories.