Skip to content

Commit

Permalink
fix: correct metric in handlePrune() (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Jun 28, 2023
1 parent 754caba commit cbdae04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ export class GossipSub extends EventEmitter<GossipsubEvents> implements PubSub<G
this.score.prune(id, topicID)
if (peersInMesh.has(id)) {
peersInMesh.delete(id)
this.metrics?.onRemoveFromMesh(topicID, ChurnReason.Unsub, 1)
this.metrics?.onRemoveFromMesh(topicID, ChurnReason.Prune, 1)
}

// is there a backoff specified by the peer? if so obey it
Expand Down
2 changes: 0 additions & 2 deletions src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ export enum ChurnReason {
BadScore = 'bad_score',
/// Peer sent a PRUNE.
Prune = 'prune',
/// Peer unsubscribed.
Unsub = 'unsubscribed',
/// Too many peers.
Excess = 'excess'
}
Expand Down

0 comments on commit cbdae04

Please sign in to comment.