mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 00:57:57 +00:00
Use libp2p 0.6.0 instead of a custom branch (#2150)
This commit is contained in:
committed by
André Silva
parent
63c3dd5a45
commit
d4a4022dd1
@@ -63,11 +63,10 @@ impl<TMessage, TSubstream> Behaviour<TMessage, TSubstream> {
|
||||
|
||||
let custom_protocols = CustomProto::new(protocol, peerset);
|
||||
|
||||
let mut kademlia = Kademlia::without_init(local_public_key.into_peer_id());
|
||||
let mut kademlia = Kademlia::new(local_public_key.into_peer_id());
|
||||
for (peer_id, addr) in &known_addresses {
|
||||
kademlia.add_connected_address(peer_id, addr.clone());
|
||||
}
|
||||
kademlia.initialize();
|
||||
|
||||
Behaviour {
|
||||
ping: Ping::new(),
|
||||
@@ -76,7 +75,7 @@ impl<TMessage, TSubstream> Behaviour<TMessage, TSubstream> {
|
||||
user_defined: known_addresses,
|
||||
kademlia,
|
||||
next_kad_random_query: Delay::new(Instant::now()),
|
||||
duration_to_next_kad: Duration::from_secs(10),
|
||||
duration_to_next_kad: Duration::from_secs(1),
|
||||
},
|
||||
identify,
|
||||
events: Vec::new(),
|
||||
|
||||
Reference in New Issue
Block a user