mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-21 04:51:33 +00:00
feat: auto relay (#723)
* feat: auto relay * fix: leverage protoBook events to ask relay peers if they support hop * chore: refactor disconnect * chore: do not listen on a relayed conn * chore: tweaks * chore: improve _listenOnAvailableHopRelays logic * chore: default value of 1 to maxListeners on auto-relay
This commit is contained in:
committed by
Vasco Santos
parent
48656712ea
commit
caf66ea143
@ -131,13 +131,12 @@ class IdentifyService {
|
||||
|
||||
/**
|
||||
* Calls `push` for all peers in the `peerStore` that are connected
|
||||
*
|
||||
* @param {PeerStore} peerStore
|
||||
* @returns {void}
|
||||
*/
|
||||
pushToPeerStore (peerStore) {
|
||||
pushToPeerStore () {
|
||||
const connections = []
|
||||
let connection
|
||||
for (const peer of peerStore.peers.values()) {
|
||||
for (const peer of this.peerStore.peers.values()) {
|
||||
if (peer.protocols.includes(MULTICODEC_IDENTIFY_PUSH) && (connection = this.connectionManager.get(peer.id))) {
|
||||
connections.push(connection)
|
||||
}
|
||||
|
Reference in New Issue
Block a user