Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-pubsub
Commits
0f6aeb23
Commit
0f6aeb23
authored
Jul 29, 2020
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disallow duplicate score inspectors
parent
e6559f59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
score.go
score.go
+6
-1
No files found.
score.go
View file @
0f6aeb23
...
...
@@ -152,6 +152,10 @@ func WithPeerScoreInspect(inspect interface{}, period time.Duration) Option {
return
fmt
.
Errorf
(
"peer scoring is not enabled"
)
}
if
gs
.
score
.
inspect
!=
nil
||
gs
.
score
.
inspectEx
!=
nil
{
return
fmt
.
Errorf
(
"duplicate peer score inspector"
)
}
switch
i
:=
inspect
.
(
type
)
{
case
PeerScoreInspectFn
:
gs
.
score
.
inspect
=
i
...
...
@@ -352,7 +356,8 @@ func (ps *peerScore) background(ctx context.Context) {
func
(
ps
*
peerScore
)
inspectScores
()
{
if
ps
.
inspect
!=
nil
{
ps
.
inspectScoresSimple
()
}
else
if
ps
.
inspectEx
!=
nil
{
}
if
ps
.
inspectEx
!=
nil
{
ps
.
inspectScoresExtended
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment