Skip to content

Commit

Permalink
feat(NodeList): handle standby nodes in refreshNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
muni-corn committed Apr 23, 2024
1 parent 3748c29 commit ffc228f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/NodeList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function addNodes(status: NodeStatus, nodes: Node[]): void {
}
}
}
export function refreshNodes(status: NodeStatus, nodes: ConsensusNodeInfo[] | JoinedConsensor[]): void {
export function refreshNodes(status: NodeStatus, nodes: Node[]): void {
if (nodes.length === 0) return
Logger.mainLogger.debug('Refreshing nodes', nodes.length, nodes)
for (const node of nodes) {
Expand All @@ -184,6 +184,9 @@ export function refreshNodes(status: NodeStatus, nodes: ConsensusNodeInfo[] | Jo
Logger.mainLogger.debug('adding new node during refresh', node.publicKey)
list.push(node)
switch (status) {
case NodeStatus.STANDBY:
standbyList.set(node.publicKey, node)
break
case NodeStatus.SYNCING:
syncingList.set(node.publicKey, node)
break
Expand Down

0 comments on commit ffc228f

Please sign in to comment.