mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-10 14:48:03 -05:00
Compare commits
1 Commits
pwhite/mas
...
skip-idont
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f39c1e037c |
@@ -932,11 +932,12 @@ method publish*(
|
||||
g.mcache.put(msgId, msg)
|
||||
|
||||
if g.parameters.sendIDontWantOnPublish:
|
||||
if isLargeMessage(msg, msgId):
|
||||
if not pubParams.skipIDontWant and isLargeMessage(msg, msgId):
|
||||
g.sendIDontWant(msg, msgId, peers)
|
||||
|
||||
when defined(libp2p_gossipsub_1_4):
|
||||
g.sendPreamble(msg, msgId, peers)
|
||||
if not pubParams.skipPreamble:
|
||||
g.sendPreamble(msg, msgId, peers)
|
||||
|
||||
g.broadcast(
|
||||
peers,
|
||||
|
||||
@@ -146,9 +146,24 @@ type
|
||||
## This callback can be used to reject topic we're not interested in
|
||||
|
||||
PublishParams* = object
|
||||
## Used to indicate whether a message will be broadcasted using a custom connection
|
||||
## defined when instantiating Pubsub, or if it will use the normal connection
|
||||
useCustomConn*: bool
|
||||
|
||||
## Can be used to avoid having the node reply to IWANT messages when initially
|
||||
## broadcasting a message, it's only after relaying its own message that the
|
||||
## node will reply to IWANTs
|
||||
skipMCache*: bool
|
||||
|
||||
## Determines whether an IDontWant message will be sent for the current message
|
||||
## when it is published if it's a large message.
|
||||
skipIDontWant*: bool
|
||||
|
||||
when defined(libp2p_gossipsub_1_4):
|
||||
## Determines whether a Preamble message will be sent for the current message
|
||||
## when it is published if it's a large message
|
||||
skipPreamble*: bool
|
||||
|
||||
PubSub* {.public.} = ref object of LPProtocol
|
||||
switch*: Switch # the switch used to dial/connect to peers
|
||||
peerInfo*: PeerInfo # this peer's info
|
||||
|
||||
Reference in New Issue
Block a user