Skip to content

Commit

Permalink
implement NetDisconnect (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
leviathanbeak authored Apr 11, 2022
1 parent ebed40a commit 6f5d900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion forest/src/cli/net_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl NetCommands {
}
Self::Disconnect { id } => match net_disconnect((id.to_owned(),)).await {
Ok(_) => {
todo!();
println!("disconnect {}: success", id);
}
Err(e) => handle_rpc_err(e),
},
Expand Down
4 changes: 2 additions & 2 deletions node/forest_libp2p/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ where
warn!("Failed to connect to a peer");
}
}
NetRPCMethods::NetDisconnect(response_channel, _peer_id) => {
warn!("NetDisconnect API not yet implmeneted"); // TODO: implement NetDisconnect - See #1181
NetRPCMethods::NetDisconnect(response_channel, peer_id) => {
let _ = Swarm::disconnect_peer_id(swarm_stream.get_mut(), peer_id);

if response_channel.send(()).is_err() {
warn!("Failed to disconnect from a peer");
Expand Down

0 comments on commit 6f5d900

Please sign in to comment.