Skip to content

Commit eaafd44

Browse files
committed
chore: do not get signed peer record n times
1 parent 931b71b commit eaafd44

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/identify/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ class IdentifyService {
9393
* @returns {Promise<void>}
9494
*/
9595
async push (connections) {
96-
const signedPeerRecord = await this._getSelfPeerRecord()
97-
const listenAddrs = this._libp2p.multiaddrs.map((ma) => ma.buffer)
98-
const protocols = Array.from(this._protocols.keys())
99-
10096
const pushes = connections.map(async connection => {
97+
const signedPeerRecord = await this._getSelfPeerRecord()
98+
const listenAddrs = this._libp2p.multiaddrs.map((ma) => ma.buffer)
99+
const protocols = Array.from(this._protocols.keys())
101100
try {
102101
const { stream } = await connection.newStream(MULTICODEC_IDENTIFY_PUSH)
103102

0 commit comments

Comments
 (0)