send fewer link announcements, fix a ttl encoding bug, and remove unnecessary key field from the wire format for dht req/res

This commit is contained in:
Arceliar 2018-02-17 21:59:08 -06:00
parent 8ba11b86bb
commit 430d49d8a4
3 changed files with 46 additions and 21 deletions

View file

@ -295,9 +295,10 @@ func (r *router) handleDHTReq(bs []byte, fromKey *boxPubKey) {
if !req.decode(bs) {
return
}
if req.key != *fromKey {
return
}
//if req.key != *fromKey {
// return
//}
req.key = *fromKey
r.core.dht.handleReq(&req)
}
@ -306,9 +307,10 @@ func (r *router) handleDHTRes(bs []byte, fromKey *boxPubKey) {
if !res.decode(bs) {
return
}
if res.key != *fromKey {
return
}
//if res.key != *fromKey {
// return
//}
res.key = *fromKey
r.core.dht.handleRes(&res)
}