Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clean up pending dial targets (#1059)
If the `Promise.race` throws, execution of the function is terminated so the pending dial target is never removed from the map and we leak memory. This can happen when there are invalid multiaddrs or when a peer reports more dialable addresses than the threshold. Instead wrap the `Promise.race` in a `try/finally` which will always remove the pending dial target in the event of success or failure.
- Loading branch information