add failed connection attempt logging

This commit is contained in:
Starbeamrainbowlabs 2022-01-08 17:29:09 +00:00
parent 135b2e8d1b
commit 046821f0ac
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -140,7 +140,11 @@ class PeerServer extends EventEmitter {
new_peer => p_retry(async () => await this.add_peer(
new_peer.address,
new_peer.port
), { retries: this.retries })
), {
retries: this.retries,
onFailedAttempt: (error, attempt, left) =>
l.error(`[attempt ${attempt} / ${left}] Error while connecting to ${new_peer.address}:${new_peer.port}: ${error}`)
})
))).filter(peer => peer instanceof Peer);
}