just reordering

This commit is contained in:
Csaba Kiraly 2022-02-16 16:09:38 +01:00
parent 6dcdaf6173
commit db4ccc8bee
1 changed files with 5 additions and 3 deletions

View File

@ -20,6 +20,11 @@ type
providers: Table[NodeId, seq[PeerRecord]]
discovery*: protocol.Protocol
## ---- AddProvider ----
const
protoIdAddProvider = "AP".toBytes()
proc addProviderLocal(p: ProvidersProtocol, cId: NodeId, prov: PeerRecord) =
trace "adding provider to local db", n=p.discovery.localNode, cId, prov
p.providers.mgetOrPut(cId, @[]).add(prov)
@ -29,9 +34,6 @@ proc recvAddProvider(p: ProvidersProtocol, nodeId: NodeId, msg: AddProviderMessa
p.addProviderLocal(msg.cId, msg.prov)
#TODO: check that CID is reasonably close to our NodeID
const
protoIdAddProvider = "AP".toBytes()
proc registerAddProvider(p: ProvidersProtocol) =
proc handler(protocol: TalkProtocol, request: seq[byte], fromId: NodeId, fromUdpAddress: Address): seq[byte]
{.gcsafe, raises: [Defect].} =