cosmetic: move a comment

This commit is contained in:
Matthias Radestock committed 2015-01-19 14:51:59 +00:00
1 parent b95d5ee182
commit 1a85990bdc
2 files changed
+11 -9

No files matched your search

+1 -9
View File
@@ -514,15 +514,7 @@ func (conn *LocalConnection) receiveTCP(decoder *gob.Decoder) {
// receiver merges it with its own topology model. If the
// payload is a subset of the receiver's topology, no
// further action is taken. Otherwise, the receiver sends
// out to all its connections an "improved" update:
// - elements which the original payload added to the
// receiver are included
// - elements which the original payload updated in the
// receiver are included
// - elements which are equal between the receiver and
// the payload are not included
// - elements where the payload was older than the
// receiver's version are updated
// out to all its connections an "improved" update.
conn.SendTCP(Concat(ProtocolUpdateByte, conn.Router.Peers.EncodeAllPeers()))
case ProtocolUpdate:
newUpdate, err := conn.Router.Peers.ApplyUpdate(msg[1:])
+10
View File
@@ -57,6 +57,16 @@ func (peers *Peers) ForEach(fun func(PeerName, *Peer)) {
}
}
// Merge an incoming update with our own topology, and
// create an "improved" update:
// - elements which the original payload added to the receiver are
// included
// - elements which the original payload updated in the receiver are
// included
// - elements which are equal between the receiver and the payload are
// not included
// - elements where the payload was older than the receiver's version
// are updated
func (peers *Peers) ApplyUpdate(update []byte) ([]byte, error) {
peers.Lock()