Versions in this module Expand all Collapse all v1 v1.9.25 Nov 14, 2020 v1.9.24 Nov 13, 2020 Changes in this version + type BalanceTracker struct + func NewBalanceTracker(ns *nodestate.NodeStateMachine, setup BalanceTrackerSetup, ...) *BalanceTracker + func (bt *BalanceTracker) GetExpirationTCs() (pos, neg uint64) + func (bt *BalanceTracker) GetPosBalanceIDs(start, stop enode.ID, maxCount int) (result []enode.ID) + func (bt *BalanceTracker) SetExpirationTCs(pos, neg uint64) + func (bt *BalanceTracker) Stop() + func (bt *BalanceTracker) TotalTokenAmount() uint64 + type BalanceTrackerSetup struct + BalanceField nodestate.Field + PriorityFlag nodestate.Flags + UpdateFlag nodestate.Flags + func NewBalanceTrackerSetup(setup *nodestate.Setup) BalanceTrackerSetup + func (bts *BalanceTrackerSetup) Connect(connAddressField, capacityField nodestate.Field) + type NodeBalance struct + func (n *NodeBalance) AddBalance(amount int64) (uint64, uint64, error) + func (n *NodeBalance) EstMinPriority(at mclock.AbsTime, capacity uint64, update bool) int64 + func (n *NodeBalance) GetBalance() (uint64, uint64) + func (n *NodeBalance) GetPriceFactors() (posFactor, negFactor PriceFactors) + func (n *NodeBalance) GetRawBalance() (utils.ExpiredValue, utils.ExpiredValue) + func (n *NodeBalance) PosBalanceMissing(targetPriority int64, targetCapacity uint64, after time.Duration) uint64 + func (n *NodeBalance) Priority(now mclock.AbsTime, capacity uint64) int64 + func (n *NodeBalance) RequestServed(cost uint64) uint64 + func (n *NodeBalance) SetBalance(pos, neg uint64) error + func (n *NodeBalance) SetPriceFactors(posFactor, negFactor PriceFactors) + type PriceFactors struct + CapacityFactor float64 + RequestFactor float64 + TimeFactor float64 + type PriorityPool struct + func NewPriorityPool(ns *nodestate.NodeStateMachine, setup PriorityPoolSetup, clock mclock.Clock, ...) *PriorityPool + func (pp *PriorityPool) Active() (uint64, uint64) + func (pp *PriorityPool) RequestCapacity(node *enode.Node, targetCap uint64, bias time.Duration, setCap bool) (minPriority int64, allowed bool) + func (pp *PriorityPool) SetActiveBias(bias time.Duration) + func (pp *PriorityPool) SetLimits(maxCount, maxCap uint64) + type PriorityPoolSetup struct + ActiveFlag nodestate.Flags + CapacityField nodestate.Field + InactiveFlag nodestate.Flags + func NewPriorityPoolSetup(setup *nodestate.Setup) PriorityPoolSetup + func (pps *PriorityPoolSetup) Connect(priorityField nodestate.Field, updateFlag nodestate.Flags)