libp2p / js-libp2p-kad-dht

JavaScript implementation of the DHT for libp2p
https://libp2p.io
Other
140 stars 60 forks source link

Stop ongoing random-walk query if stopped #102

Open vasco-santos opened 5 years ago

vasco-santos commented 5 years ago

As discussed on libp2p/js-libp2p-kad-dht#101, we should stop ab ongoing random-walk query if the random-walk is stopped, as we will not get anything from the queries results

jacobheun commented 5 years ago

With https://github.com/libp2p/js-libp2p-kad-dht/pull/104, once findPeer has support for AbortController, aborting an active random walk query will happen automatically provided findPeer is given the AbortController signal via options.signal