msglist

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(db ITxListDB) *Cache

func (*Cache) All

func (c *Cache) All() []types.IMessage

func (*Cache) Exist

func (c *Cache) Exist(msgHash string) bool

func (*Cache) Len

func (c *Cache) Len() int

func (*Cache) Put

func (c *Cache) Put(msg types.IMessage) error

func (*Cache) Remove

func (c *Cache) Remove(msg types.IMessage)

type ITxListDB

type ITxListDB interface {
	Read() []types.IMessage
	Save(message types.IMessage)
	Delete(msg types.IMessage)
	Clear()
	Close() error
}

type MsgManagement

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

func NewMsgManagement

func NewMsgManagement(validator validator.IValidator, actStatus types.IActStatus) (*MsgManagement, error)

func (*MsgManagement) Close

func (t *MsgManagement) Close() error

func (*MsgManagement) Count

func (t *MsgManagement) Count() int

func (*MsgManagement) Delete

func (t *MsgManagement) Delete(msg types.IMessage)

func (*MsgManagement) DeleteEnd

func (t *MsgManagement) DeleteEnd(newTx types.IMessage)

func (*MsgManagement) DeleteExpired

func (t *MsgManagement) DeleteExpired(timeThreshold int64)

func (*MsgManagement) Exist

func (t *MsgManagement) Exist(msg types.IMessage) bool

func (*MsgManagement) GetAll

func (t *MsgManagement) GetAll() ([]types.IMessage, []types.IMessage)

func (*MsgManagement) NeedPackaged

func (t *MsgManagement) NeedPackaged(count int) []types.IMessage

func (*MsgManagement) Put

func (t *MsgManagement) Put(msg types.IMessage) error

func (*MsgManagement) Read

func (t *MsgManagement) Read() error

func (*MsgManagement) StagnantMsgs

func (t *MsgManagement) StagnantMsgs() []types.IMessage

func (*MsgManagement) Update

func (t *MsgManagement) Update()

type Sorted

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

func NewSorted

func NewSorted(db ITxListDB) *Sorted

func (*Sorted) All

func (t *Sorted) All() []types.IMessage

func (*Sorted) Exist

func (t *Sorted) Exist(from string, msgHash string) bool

func (*Sorted) GetByAddress

func (t *Sorted) GetByAddress(addr string) types.IMessage

func (*Sorted) Len

func (t *Sorted) Len() int

func (*Sorted) NeedPackaged

func (t *Sorted) NeedPackaged(count int) []types.IMessage

func (*Sorted) PopMin

func (t *Sorted) PopMin(fees uint64) types.IMessage

If the message pool is full, delete the message with a small fee

func (*Sorted) Put

func (t *Sorted) Put(msg types.IMessage)

func (*Sorted) Remove

func (t *Sorted) Remove(msg types.IMessage)

func (*Sorted) RemoveExecuted

func (t *Sorted) RemoveExecuted(v validator.IValidator)

Delete already packed messages

func (*Sorted) RemoveExpiredTx

func (t *Sorted) RemoveExpiredTx(timeThreshold int64)

Delete expired messages

func (*Sorted) StagnantMsgs

func (t *Sorted) StagnantMsgs() []types.IMessage

Jump to

Keyboard shortcuts

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