Skip to content

Commit

Permalink
add back nodelistFromStates to handle network restart and variable na…
Browse files Browse the repository at this point in the history
…me fix
  • Loading branch information
dnlbui committed Aug 21, 2024
1 parent 8ffe854 commit c15da3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/p2p/Join/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,7 @@ function decideNodeSelection(joinRequest: P2P.JoinTypes.JoinRequest): JoinReques
}

export function nodelistFromStates(states: P2P.P2PTypes.NodeStatus[]): P2P.NodeListTypes.Node[] {
if (Self.isRestartNetwork) return NodeList.byIdOrder
const { NodeStatus } = P2P.P2PTypes
const stateMappings: { [key in P2P.P2PTypes.NodeStatus]?: P2P.NodeListTypes.Node[] } = {
[NodeStatus.ACTIVE]: NodeList.activeByIdOrder,
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/Join/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const unjoinRoute: P2P.P2PTypes.Route<Handler> = {

Comms.sendGossip(
'gossip-unjoin',
joinRequest,
unjoinRequest,
'',
null,
nodelistFromStates([
Expand Down

0 comments on commit c15da3e

Please sign in to comment.