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.} =
|
proc encodePrune*(prune: ControlPrune, pb: var ProtoBuffer) {.gcsafe.} =
|
||||||
pb.write(initProtoField(1, prune.topicID))
|
pb.write(initProtoField(1, prune.topicID))
|
||||||
|
|
||||||
|
var peers = initProtoBuffer()
|
||||||
for p in prune.peers:
|
for p in prune.peers:
|
||||||
encodePeerInfo(p, pb)
|
p.encodePeerInfo(peers)
|
||||||
|
peers.finish()
|
||||||
|
pb.write(initProtoField(2, peers))
|
||||||
|
|
||||||
pb.write(initProtoField(3, prune.backoff))
|
pb.write(initProtoField(3, prune.backoff))
|
||||||
|
|
||||||
proc decodePrune*(pb: var ProtoBuffer): seq[ControlPrune] {.gcsafe.} =
|
proc decodePrune*(pb: var ProtoBuffer): seq[ControlPrune] {.gcsafe.} =
|
||||||
|
|
Loading…
Reference in New Issue