Documentation ¶
Index ¶
- func Check(checks []TxnCheckFn, stxn *SignedTxn) error
- type ItxPool
- type IunpackedTxns
- type TxPool
- func (tp *TxPool) BaseCheck(stxn *SignedTxn) error
- func (tp *TxPool) Capacity() int
- func (tp *TxPool) CheckTxn(stxn *SignedTxn) (err error)
- func (tp *TxPool) Exist(txnHash Hash) bool
- func (tp *TxPool) GetAllTxns() ([]*SignedTxn, error)
- func (tp *TxPool) GetTxn(hash Hash) (*SignedTxn, error)
- func (tp *TxPool) Insert(stxn *SignedTxn) error
- func (tp *TxPool) NecessaryCheck(stxn *SignedTxn) (err error)
- func (tp *TxPool) Pack(numLimit uint64) ([]*SignedTxn, error)
- func (tp *TxPool) PackFor(numLimit uint64, filter func(txn *SignedTxn) bool) ([]*SignedTxn, error)
- func (tp *TxPool) Reset(txns SignedTxns) error
- func (tp *TxPool) ResetByHashes(hashes []Hash) error
- func (tp *TxPool) SetOrder(order map[int]Hash)
- func (tp *TxPool) SetPackFilter(fn func(txn *SignedTxn) bool)
- func (tp *TxPool) Size() int
- func (tp *TxPool) SortTxns(fn func(txns []*SignedTxn) []*SignedTxn)
- func (tp *TxPool) TripodsCheck(stxn *SignedTxn) error
- func (tp *TxPool) WithBaseCheck(tc TxnChecker) ItxPool
- func (tp *TxPool) WithTripodCheck(tripodName string, tc TxnChecker) ItxPool
- type TxnCheckFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(checks []TxnCheckFn, stxn *SignedTxn) error
Types ¶
type ItxPool ¶
type ItxPool interface { // Capacity return pool capacity of txpool Capacity() int // Size return pool size of txpool Size() int WithBaseCheck(checkFn TxnChecker) ItxPool WithTripodCheck(tripodName string, checker TxnChecker) ItxPool SetPackFilter(fn func(txn *SignedTxn) bool) BaseCheck(*SignedTxn) error TripodsCheck(stxn *SignedTxn) error // NecessaryCheck uses for SyncTxns NecessaryCheck(stxn *SignedTxn) error Exist(txnHash Hash) bool CheckTxn(stxn *SignedTxn) error Insert(txn *SignedTxn) error SetOrder(order map[int]Hash) SortTxns(fn func(txns []*SignedTxn) []*SignedTxn) // Pack packs some txns to send to tripods Pack(numLimit uint64) ([]*SignedTxn, error) PackFor(numLimit uint64, filter func(txn *SignedTxn) bool) ([]*SignedTxn, error) // GetTxn returns unpacked txn GetTxn(hash Hash) (*SignedTxn, error) GetAllTxns() ([]*SignedTxn, error) // Reset Deletes packed txns Reset(txns SignedTxns) error ResetByHashes(hashes []Hash) error }
type IunpackedTxns ¶
type IunpackedTxns interface { Insert(input *SignedTxn) error Deletes(txnHashes []Hash) Exist(txnHash Hash) bool Get(txnHash Hash) *SignedTxn GetAll() []*SignedTxn Gets(numLimit uint64, filter func(txn *SignedTxn) bool) []*SignedTxn SortTxns(fn func(txns []*SignedTxn) []*SignedTxn) SetOrder(order map[int]Hash) Size() int }
type TxPool ¶
type TxPool struct { TxnMaxSize int // contains filtered or unexported fields }
func WithDefaultChecks ¶
func (*TxPool) GetAllTxns ¶
func (*TxPool) NecessaryCheck ¶
func (*TxPool) ResetByHashes ¶
func (*TxPool) SetPackFilter ¶ added in v1.2.8
func (*TxPool) TripodsCheck ¶
func (*TxPool) WithBaseCheck ¶
func (*TxPool) WithTripodCheck ¶
type TxnCheckFn ¶
type TxnCheckFn func(*SignedTxn) error
Click to show internal directories.
Click to hide internal directories.