From 7b2d637382d34be4e1ba6621f080965fba5eb5aa Mon Sep 17 00:00:00 2001 From: lla-dane Date: Sat, 23 Aug 2025 16:30:34 +0530 Subject: [PATCH] Now using env_to_send_in_RPC for issuing records in Identify rpc messages --- libp2p/identity/identify/identify.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libp2p/identity/identify/identify.py b/libp2p/identity/identify/identify.py index 4e8931ba..146fbd2d 100644 --- a/libp2p/identity/identify/identify.py +++ b/libp2p/identity/identify/identify.py @@ -15,7 +15,7 @@ from libp2p.custom_types import ( from libp2p.network.stream.exceptions import ( StreamClosed, ) -from libp2p.peer.peerstore import create_signed_peer_record +from libp2p.peer.peerstore import env_to_send_in_RPC from libp2p.utils import ( decode_varint_with_size, get_agent_version, @@ -65,11 +65,7 @@ def _mk_identify_protobuf( protocols = tuple(str(p) for p in host.get_mux().get_protocols() if p is not None) # Create a signed peer-record for the remote peer - envelope = create_signed_peer_record( - host.get_id(), - host.get_addrs(), - host.get_private_key(), - ) + envelope_bytes, _ = env_to_send_in_RPC(host) observed_addr = observed_multiaddr.to_bytes() if observed_multiaddr else b"" return Identify( @@ -79,7 +75,7 @@ def _mk_identify_protobuf( listen_addrs=map(_multiaddr_to_bytes, laddrs), observed_addr=observed_addr, protocols=protocols, - signedPeerRecord=envelope.marshal_envelope(), + signedPeerRecord=envelope_bytes, )