go-libp2p
go-libp2p copied to clipboard
pnet: misleading error `errShortNonce` during ECONNRESET on Read
trafficstars
While using a PrivareNetwork (psk) between peers, a general errShortNonce error is returned:
failed to negotiate security protocol: privnet: could not read full nonce
The actual reason for the failure is obscured.
For example, when the connection was reset (probably by the peer) .
As a minimum the original error (ECONNRESET in this case) should be wrapped as part of the retuned error.