replaced todo placeholders
This commit is contained in:
parent
7e9da72dc5
commit
085be771fe
@ -155,11 +155,12 @@ impl Bitswap {
|
||||
/// Called from Kademlia behaviour.
|
||||
pub fn connect(&mut self, peer_id: PeerId) {
|
||||
if self.target_peers.insert(peer_id) {
|
||||
let handler = self.new_handler();
|
||||
self.events.push_back(NetworkBehaviourAction::Dial {
|
||||
opts: DialOpts::peer_id(peer_id)
|
||||
.condition(PeerCondition::Disconnected)
|
||||
.build(),
|
||||
handler: todo!(),
|
||||
handler,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,7 @@ use libp2p::core::{
|
||||
};
|
||||
use libp2p::floodsub::{Floodsub, FloodsubConfig, FloodsubEvent, FloodsubMessage, Topic};
|
||||
use libp2p::swarm::{
|
||||
ConnectionHandler, DialError, IntoConnectionHandler, NetworkBehaviour, NetworkBehaviourAction,
|
||||
PollParameters,
|
||||
ConnectionHandler, DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters,
|
||||
};
|
||||
|
||||
/// Currently a thin wrapper around Floodsub, perhaps supporting both Gossipsub and Floodsub later.
|
||||
|
@ -111,13 +111,14 @@ impl SwarmApi {
|
||||
.connect_registry
|
||||
.create_subscription(addr.clone().into(), None);
|
||||
|
||||
let handler = self.new_handler();
|
||||
self.events.push_back(NetworkBehaviourAction::Dial {
|
||||
// rationale: this is sort of explicit command, perhaps the old address is no longer
|
||||
// valid. Always would be even better but it's bugged at the moment.
|
||||
opts: DialOpts::peer_id(addr.peer_id)
|
||||
.condition(PeerCondition::NotDialing)
|
||||
.build(),
|
||||
handler: todo!(),
|
||||
handler,
|
||||
});
|
||||
|
||||
self.pending_addresses
|
||||
@ -308,11 +309,12 @@ impl NetworkBehaviour for SwarmApi {
|
||||
if self.pending_addresses.contains_key(&peer_id) {
|
||||
// it is possible that these addresses have not been tried yet; they will be asked
|
||||
// for soon.
|
||||
let handler = self.new_handler();
|
||||
self.events.push_back(swarm::NetworkBehaviourAction::Dial {
|
||||
opts: DialOpts::peer_id(peer_id)
|
||||
.condition(PeerCondition::NotDialing)
|
||||
.build(),
|
||||
handler: todo!(),
|
||||
handler,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user