mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 21:44:24 +00:00
control prune updates (pb)
This commit is contained in:
parent
73972ec9ce
commit
6eb651d43a
@ -20,9 +20,19 @@ proc write*(pb: var ProtoBuffer, field: int, graft: ControlGraft) =
|
||||
ipb.finish()
|
||||
pb.write(field, ipb)
|
||||
|
||||
proc write*(pb: var ProtoBuffer, field: int, infoMsg: PeerInfoMsg) =
|
||||
var ipb = initProtoBuffer()
|
||||
ipb.write(1, infoMsg.peerID)
|
||||
ipb.write(2, infoMsg.signedPeerRecord)
|
||||
ipb.finish()
|
||||
pb.write(field, ipb)
|
||||
|
||||
proc write*(pb: var ProtoBuffer, field: int, prune: ControlPrune) =
|
||||
var ipb = initProtoBuffer()
|
||||
ipb.write(1, prune.topicID)
|
||||
for peer in prune.peers:
|
||||
ipb.write(2, peer)
|
||||
ipb.write(3, prune.backoff)
|
||||
ipb.finish()
|
||||
pb.write(field, ipb)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user