Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
6ae24c91
Commit
6ae24c91
authored
4 years ago
by
Pierre Krieger
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix Network trait implementation not doing what it's supposed to do (#7985)
parent
054b0f54
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/client/network-gossip/src/lib.rs
+2
-2
2 additions, 2 deletions
substrate/client/network-gossip/src/lib.rs
with
2 additions
and
2 deletions
substrate/client/network-gossip/src/lib.rs
+
2
−
2
View file @
6ae24c91
...
...
@@ -113,7 +113,7 @@ impl<B: BlockT, H: ExHashT> Network<B> for Arc<NetworkService<B, H>> {
fn
add_set_reserved
(
&
self
,
who
:
PeerId
,
protocol
:
Cow
<
'static
,
str
>
)
{
let
addr
=
iter
::
once
(
multiaddr
::
Protocol
::
P2p
(
who
.into
()))
.collect
::
<
multiaddr
::
Multiaddr
>
();
let
result
=
NetworkService
::
add_
to_
peers_set
(
self
,
protocol
,
iter
::
once
(
addr
)
.collect
());
let
result
=
NetworkService
::
add_peers
_to_reserved
_set
(
self
,
protocol
,
iter
::
once
(
addr
)
.collect
());
if
let
Err
(
err
)
=
result
{
log
::
error!
(
target
:
"gossip"
,
"add_set_reserved failed: {}"
,
err
);
}
...
...
@@ -122,7 +122,7 @@ impl<B: BlockT, H: ExHashT> Network<B> for Arc<NetworkService<B, H>> {
fn
remove_set_reserved
(
&
self
,
who
:
PeerId
,
protocol
:
Cow
<
'static
,
str
>
)
{
let
addr
=
iter
::
once
(
multiaddr
::
Protocol
::
P2p
(
who
.into
()))
.collect
::
<
multiaddr
::
Multiaddr
>
();
let
result
=
NetworkService
::
remove_
from_
peers_set
(
self
,
protocol
,
iter
::
once
(
addr
)
.collect
());
let
result
=
NetworkService
::
remove_peers
_from_reserved
_set
(
self
,
protocol
,
iter
::
once
(
addr
)
.collect
());
if
let
Err
(
err
)
=
result
{
log
::
error!
(
target
:
"gossip"
,
"remove_set_reserved failed: {}"
,
err
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment