Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
CacheManager maintain a store of the transaction that signer already signed
func NewSignerCacheManager ¶
func NewSignerCacheManager(db *leveldb.DB) (*CacheManager, error)
NewSignerCacheManager create a new instance of CacheManager
func (*CacheManager) HasSigned ¶
func (cm *CacheManager) HasSigned(txOutItemHash string) bool
HasSigned check whether the given tx out item has been signed before
func (*CacheManager) RemoveSigned ¶
func (cm *CacheManager) RemoveSigned(transactionHash string)
RemoveSigned remove the given transaction hash related tx out item cache Usually this means the given transaction failed, so need to remove it from cache , so it can retry
func (*CacheManager) SetSigned ¶
func (cm *CacheManager) SetSigned(txOutItemHash, transactionHash string) error
SetSigned mark a tx out item has been signed
type CacheStore ¶
type CacheStore struct {
// contains filtered or unexported fields
}
CacheStore manage the key value store used to store what tx out items have been signed before
func NewCacheStore ¶
func NewCacheStore(db *leveldb.DB) *CacheStore
NewCacheStore create a new intance of CacheStore
func (*CacheStore) HasSigned ¶
func (s *CacheStore) HasSigned(hash string) bool
HasSigned check whether the given height and hash has been signed before or not
func (*CacheStore) RemoveSigned ¶
func (s *CacheStore) RemoveSigned(transactionHash string) error
RemoveSigned delete a hash from the signed cache
func (*CacheStore) SetSigned ¶
func (s *CacheStore) SetSigned(hash string) error
SetSigned update key value store to set the given height and hash as signed
func (*CacheStore) SetTransactionHashMap ¶
func (s *CacheStore) SetTransactionHashMap(txOutItemHash, transactionHash string) error
SetTransactionHashMap map a transaction hash to a tx out item hash