fix typo in comments (#1840)

* remove global error tracking

* rpc_server: fix invalid register err

* fix typo

Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
Di Wu
2020-07-16 23:33:11 +08:00
committed by GitHub
parent dfa50a888d
commit f9bf562393
20 changed files with 30 additions and 30 deletions

View File

@@ -634,7 +634,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
// receive control message queue
recv := make(chan *message, 128)
// accept ControlChannel cconnections
// accept ControlChannel connections
go n.acceptCtrlConn(listener, recv)
for {
@@ -660,7 +660,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) {
logger.Debugf("Network received advert message from: %s", pbRtrAdvert.Id)
}
// loookup advertising node in our peer topology
// lookup advertising node in our peer topology
advertNode := n.node.GetPeerNode(pbRtrAdvert.Id)
if advertNode == nil {
// if we can't find the node in our topology (MaxDepth) we skipp prcessing adverts
@@ -913,7 +913,7 @@ func (n *network) processNetChan(listener tunnel.Listener) {
logger.Debugf("Network failed refreshing peer %s: %v", pbNetPeer.Node.Id, err)
}
// NOTE: we don't unpack MaxDepth toplogy
// NOTE: we don't unpack MaxDepth topology
peer = UnpackPeerTopology(pbNetPeer, now, MaxDepth-1)
// update the link
peer.link = m.msg.Header["Micro-Link"]
@@ -1217,7 +1217,7 @@ func (n *network) manage() {
lastSent := links[peer.link]
// check when we last sent to the peer
// and send a peer message if we havent
// and send a peer message if we haven't
if lastSent.IsZero() || time.Since(lastSent) > KeepAliveTime {
link := peer.link
id := peer.id
@@ -1351,7 +1351,7 @@ func (n *network) manage() {
// pick a random peer from the list of peers and request full sync
peer := n.node.GetPeerNode(peers[rnd.Intn(len(peers))].Id())
// skip if we can't find randmly selected peer
// skip if we can't find randomly selected peer
if peer == nil {
continue
}

View File

@@ -167,7 +167,7 @@ func (n *node) walk(until func(peer *node) bool, action func(parent, peer *node)
return visited
}
// iterate through all of the node peers
// mark the visited nodes; enqueue the non-visted
// mark the visited nodes; enqueue the non-visited
for id, peer := range qnode.Value.(*node).peers {
action(qnode.Value.(*node), peer)
if _, ok := visited[id]; !ok {
@@ -274,7 +274,7 @@ func (n *node) RefreshSync(now time.Time) error {
// Nodes returns a slice of all nodes in the whole node topology
func (n *node) Nodes() []Node {
// we need to freeze the network graph here
// otherwise we might get inconsisten results
// otherwise we might get inconsistent results
n.RLock()
defer n.RUnlock()