mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
now ignoring pubsub messages upon receving invalid-signed-records
This commit is contained in:
@ -229,7 +229,9 @@ class GossipSub(IPubsubRouter, Service):
|
||||
"""
|
||||
# Process the senderRecord if sent
|
||||
if isinstance(self.pubsub, Pubsub):
|
||||
_ = maybe_consume_signed_record(rpc, self.pubsub.host)
|
||||
if not maybe_consume_signed_record(rpc, self.pubsub.host):
|
||||
logger.error("Received an invalid-signed-record, ignoring the message")
|
||||
return
|
||||
|
||||
control_message = rpc.control
|
||||
|
||||
|
||||
@ -270,7 +270,11 @@ class Pubsub(Service, IPubsub):
|
||||
rpc_incoming.ParseFromString(incoming)
|
||||
|
||||
# Process the sender's signed-record if sent
|
||||
_ = maybe_consume_signed_record(rpc_incoming, self.host)
|
||||
if not maybe_consume_signed_record(rpc_incoming, self.host):
|
||||
logger.error(
|
||||
"Received an invalid-signed-record, ignoring the incoming msg"
|
||||
)
|
||||
continue
|
||||
|
||||
if rpc_incoming.publish:
|
||||
# deal with RPC.publish
|
||||
|
||||
Reference in New Issue
Block a user