Skip to content

Commit

Permalink
chore: address final comments
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Dec 6, 2023
1 parent d3e970f commit d0463b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/pocketcore/types/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ func NewSessionNodes(
) (sessionNodes SessionNodes, err sdk.Error) {
// retrieve the enforce max chains flag's value from the codec
isEnforceMaxChains := ModuleCdc.IsAfterEnforceMaxChainsUpgrade(ctx.BlockHeight())
// retrieve the max chains value from the sessionCtx
nodeMaxChains := keeper.MaxChains(sessionCtx)
// all nodesAddrs at session genesis
nodesAddrs, totalNodes := keeper.GetValidatorsByChain(sessionCtx, chain)
// validate nodesAddrs
Expand Down Expand Up @@ -151,7 +153,7 @@ func NewSessionNodes(
lenNodeChains := int64(len(node.GetChains()))
// if not found or jailed or is overstaked to chains
if node == nil ||
(isEnforceMaxChains && lenNodeChains > keeper.MaxChains(ctx)) ||
(isEnforceMaxChains && lenNodeChains > nodeMaxChains) ||
node.IsJailed() ||
!NodeHasChain(chain, node) ||
sessionNodes.Contains(node.GetAddress()) {
Expand Down

0 comments on commit d0463b3

Please sign in to comment.