mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
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:
parent
8ba11b86bb
commit
430d49d8a4
3 changed files with 46 additions and 21 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue