Skip to content

Commit

Permalink
les/vflux/server: set inactiveFlag in priorityPool
Browse files Browse the repository at this point in the history
  • Loading branch information
zsfelfoldi committed Mar 29, 2021
1 parent 50ddf0e commit f1000d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions les/vflux/server/clientpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ func NewClientPool(balanceDb ethdb.KeyValueStore, minCap uint64, connectedBias t
}
})

ns.SubscribeField(setup.balanceField, func(node *enode.Node, state nodestate.Flags, oldValue, newValue interface{}) {
if newValue != nil {
ns.SetStateSub(node, setup.inactiveFlag, nodestate.Flags{}, 0)
}
})

ns.SubscribeField(setup.capacityField, func(node *enode.Node, state nodestate.Flags, oldValue, newValue interface{}) {
if c, ok := ns.GetField(node, setup.clientField).(clientPeer); ok {
newCap, _ := newValue.(uint64)
Expand Down
1 change: 1 addition & 0 deletions les/vflux/server/prioritypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func newPriorityPool(ns *nodestate.NodeStateMachine, setup *serverSetup, clock m
stepDiv: pp.capacityStepDiv,
}
ns.SetFieldSub(node, pp.setup.queueField, c)
ns.SetStateSub(node, setup.inactiveFlag, nodestate.Flags{}, 0)
} else {
ns.SetStateSub(node, nodestate.Flags{}, pp.setup.activeFlag.Or(pp.setup.inactiveFlag), 0)
if n, _ := pp.ns.GetField(node, pp.setup.queueField).(*ppNodeInfo); n != nil {
Expand Down

0 comments on commit f1000d6

Please sign in to comment.