You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getClosestPeers function in peer-routing.js returns more than K nodes when using the kad dht module.
The reason for this is that the getClosestPeers function in the kad-dht module yields not only FINAL_PEER events, but also DIALING_PEER, PEER_RESPONSE and SENDING_QUERYevents. In order to be compatible, either getClosestPeers from kad-dht module should return only FINAL_PEER events, or the getClosestPeers function in peer-routing.js should filter sources by FINAL_PEER events.
The text was updated successfully, but these errors were encountered:
@wemeetagain I made a PR for this, and also found a bug that slows down kad dht find closest peers quite a bit. Please take a look when you have some time :)
If you're only interested in the closest peers, you should disregard all events that are not FINAL_PEER. The others are useful for tracing and diagnostics, and for giving the user some feedback their query has not stalled but should not be treated as actual results.
The
getClosestPeers
function inpeer-routing.js
returns more than K nodes when using the kad dht module.The reason for this is that the
getClosestPeers
function in the kad-dht module yields not onlyFINAL_PEER
events, but alsoDIALING_PEER, PEER_RESPONSE and SENDING_QUERY
events. In order to be compatible, eithergetClosestPeers
from kad-dht module should return onlyFINAL_PEER
events, or thegetClosestPeers
function inpeer-routing.js
should filter sources byFINAL_PEER
events.The text was updated successfully, but these errors were encountered: