mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-09 03:28:14 -05:00
fix(issue-1052): Single topic for RPC Message (#1061)
This commit is contained in:
committed by
GitHub
parent
a2027003cd
commit
458b0885dd
@@ -148,12 +148,15 @@ method rpcHandler*(f: FloodSub,
|
||||
discard
|
||||
|
||||
var toSendPeers = initHashSet[PubSubPeer]()
|
||||
for t in msg.topicIds: # for every topic in the message
|
||||
if t notin f.topics:
|
||||
continue
|
||||
f.floodsub.withValue(t, peers): toSendPeers.incl(peers[])
|
||||
let topic = msg.topic
|
||||
if topic notin f.topics:
|
||||
debug "Dropping message due to topic not in floodsub topics", topic, msgId, peer
|
||||
continue
|
||||
|
||||
await handleData(f, t, msg.data)
|
||||
f.floodsub.withValue(topic, peers):
|
||||
toSendPeers.incl(peers[])
|
||||
|
||||
await handleData(f, topic, msg.data)
|
||||
|
||||
# In theory, if topics are the same in all messages, we could batch - we'd
|
||||
# also have to be careful to only include validated messages
|
||||
|
||||
Reference in New Issue
Block a user