Skip to content

Commit

Permalink
while reporting, create a node in peerset
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Aug 31, 2024
1 parent c22065f commit 2f0b3a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dot/peerset/peerstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func (ps *PeersState) addReputation(peerID peer.ID, change ReputationChange) (

node, has := ps.nodes[peerID]
if !has {
return 0, fmt.Errorf("%w: for peer id %s", ErrPeerDoesNotExist, peerID)
ps.insertPeer(0, peerID)
node = ps.nodes[peerID]
}

newReputation = node.addReputation(change.Value)
Expand Down

0 comments on commit 2f0b3a0

Please sign in to comment.