1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-30 07:40:25 +08:00

add link rep

This commit is contained in:
fumiama
2021-12-30 16:35:37 +08:00
parent 66c200b708
commit db5ac5787e
2 changed files with 10 additions and 6 deletions

View File

@@ -5,7 +5,6 @@ import (
"net"
"sync"
"github.com/fumiama/WireGold/helper"
"github.com/sirupsen/logrus"
)
@@ -85,11 +84,7 @@ func (r *Router) SetItem(ip *net.IPNet, l *Link) {
copy(r.list[i+1:], r.list[i:len(r.list)-1])
r.list[i] = ip
r.table[ip.String()] = l
lnkname := "default"
if l.pubk != nil {
lnkname = helper.BytesToString(l.pubk[:24])
}
logrus.Infoln("[router] add route in link", lnkname, "to", ip, "-->", l.peerip)
logrus.Infoln("[router] add route in link", l, "to", ip, "-->", l.peerip)
break
}
}