Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 9abf468

Browse files
author
Alan Shaw
committed
refactor: share noop callback
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 897590a commit 9abf468

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/components/libp2p.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ module.exports = function libp2p (self, config) {
1919
const libp2p = createBundle({ options, config, datastore, peerInfo, peerBook })
2020
let discoveredPeers = []
2121

22+
const noop = () => {}
2223
const putAndDial = peerInfo => {
2324
peerInfo = peerBook.put(peerInfo)
2425
if (!peerInfo.isConnected()) {
25-
libp2p.dial(peerInfo, () => {})
26+
libp2p.dial(peerInfo, noop)
2627
}
2728
}
2829

0 commit comments

Comments
 (0)