Skip to content

Commit

Permalink
always send node-deactivated event
Browse files Browse the repository at this point in the history
  • Loading branch information
PudgyPug authored and kgmyatthu committed Oct 8, 2024
1 parent c3b2a03 commit 895b156
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/p2p/NodeList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,19 @@ export function removeNode(
cycleNumber: cycle.counter,
}
emitter.emit('node-left-early', emitParams)
} else {
const emitParams: Omit<ShardusEvent, 'type'> = {
nodeId: node.id,
reason: 'Node deactivated',
time: cycle.start,
publicKey: node.publicKey,
cycleNumber: cycle.counter,
activeCycle: node.activeCycle,
}
if (cycle.mode === 'shutdown' || networkMode === 'shutdown') {
return
}
emitter.emit('node-deactivated', emitParams)
}
const emitParams: Omit<ShardusEvent, 'type'> = {
nodeId: node.id,
reason: 'Node deactivated',
time: cycle.start,
publicKey: node.publicKey,
cycleNumber: cycle.counter,
activeCycle: node.activeCycle,
}
if (cycle.mode === 'shutdown' || networkMode === 'shutdown') {
return
}
emitter.emit('node-deactivated', emitParams)
}
}

Expand Down

0 comments on commit 895b156

Please sign in to comment.