Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TransferSizeLimit is the maximum size of transfer allowed TransferSizeLimit = 32 * 1024 // VoteSizeLimit is the maximum size of vote allowed VoteSizeLimit = 236 // GlobalSlots indicate maximum number of actions the whole actpool can hold GlobalSlots = 8192 // AccountSlots indicate maximum number of an account queue can hold AccountSlots = 256 )
Variables ¶
View Source
var ( // ErrInvalidAddr is the error that the address format is invalid, cannot be decoded ErrInvalidAddr = errors.New("address format is invalid") // ErrActPool indicates the error of actpool ErrActPool = errors.New("invalid actpool") // ErrTransfer indicates the error of transfer ErrTransfer = errors.New("invalid transfer") // ErrNonce indicates the error of nonce ErrNonce = errors.New("invalid nonce") // ErrBalance indicates the error of balance ErrBalance = errors.New("invalid balance") )
Functions ¶
This section is empty.
Types ¶
type ActPool ¶
type ActPool interface {
// Reset resets actpool state
Reset()
// PickActs returns all currently accepted transfers and votes in actpool
PickActs() ([]*action.Transfer, []*action.Vote)
// AddTsf adds an transfer into the pool after passing validation
AddTsf(tsf *action.Transfer) error
// AddVote adds a vote into the pool after passing validation
AddVote(vote *action.Vote) error
}
ActPool is the interface of actpool
type ActQueue ¶
type ActQueue interface {
Overlaps(*iproto.ActionPb) bool
Put(*iproto.ActionPb) error
FilterNonce(uint64) []*iproto.ActionPb
UpdateNonce(uint64)
SetConfirmedNonce(uint64)
ConfirmedNonce() uint64
SetPendingNonce(uint64)
PendingNonce() uint64
SetPendingBalance(*big.Int)
PendingBalance() *big.Int
Len() int
Empty() bool
ConfirmedActs() []*iproto.ActionPb
}
ActQueue is the interface of actQueue
Click to show internal directories.
Click to hide internal directories.