mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-09 03:28:14 -05:00
Peer resultification and defect only (#245)
* Peer resultification and defect only * Fixing some tests * test fixes * Rename peer into peerid * better result error message in identify * further merge fixes
This commit is contained in:
committed by
GitHub
parent
c788a6a3c0
commit
ec00c7fc50
@@ -12,7 +12,7 @@ import chronicles
|
||||
import stew/[endians2, byteutils]
|
||||
import nimcrypto/[utils, sysrand, sha2, hmac]
|
||||
import ../../stream/lpstream
|
||||
import ../../peer
|
||||
import ../../peerid
|
||||
import ../../peerinfo
|
||||
import ../../protobuf/minprotobuf
|
||||
import ../../utility
|
||||
@@ -460,7 +460,7 @@ method handshake*(p: Noise, conn: Connection, initiator: bool): Future[SecureCon
|
||||
let pid = PeerID.init(remotePubKey)
|
||||
if not conn.peerInfo.peerId.validate():
|
||||
raise newException(NoiseHandshakeError, "Failed to validate peerId.")
|
||||
if pid != conn.peerInfo.peerId:
|
||||
if pid.isErr or pid.get() != conn.peerInfo.peerId:
|
||||
var
|
||||
failedKey: PublicKey
|
||||
discard extractPublicKey(conn.peerInfo.peerId, failedKey)
|
||||
|
||||
Reference in New Issue
Block a user