mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 21:44:24 +00:00
fix encodePrune
This commit is contained in:
parent
7748b8c5c9
commit
eea48f8bd5
@ -32,8 +32,13 @@ proc encodePeerInfo*(info: PeerInfoMsg, pb: var ProtoBuffer) {.gcsafe.} =
|
||||
|
||||
proc encodePrune*(prune: ControlPrune, pb: var ProtoBuffer) {.gcsafe.} =
|
||||
pb.write(initProtoField(1, prune.topicID))
|
||||
|
||||
var peers = initProtoBuffer()
|
||||
for p in prune.peers:
|
||||
encodePeerInfo(p, pb)
|
||||
p.encodePeerInfo(peers)
|
||||
peers.finish()
|
||||
pb.write(initProtoField(2, peers))
|
||||
|
||||
pb.write(initProtoField(3, prune.backoff))
|
||||
|
||||
proc decodePrune*(pb: var ProtoBuffer): seq[ControlPrune] {.gcsafe.} =
|
||||
|
Loading…
x
Reference in New Issue
Block a user