refactor: give Peers knowledge of Ourself.Peer and MacCache

so their use (when applying updates and performing gc) is opaque
This commit is contained in:
Matthias Radestock committed 2014-12-25 13:49:58 +00:00
1 parent af59b38134
commit 75ed7d52b9
4 files changed
+23 -17

No files matched your search

+1 -1
View File
@@ -495,7 +495,7 @@ func (conn *LocalConnection) receiveTCP(decoder *gob.Decoder, usingPassword bool
// receiver's version are updated
conn.SendTCP(Concat(ProtocolUpdateByte, conn.Router.Peers.EncodeAllPeers()))
} else if msg[0] == ProtocolUpdate {
newUpdate, err := conn.Router.Peers.ApplyUpdate(msg[1:], conn.Router.Ourself.Peer, conn.Router.Macs)
newUpdate, err := conn.Router.Peers.ApplyUpdate(msg[1:])
if _, ok := err.(UnknownPeersError); err != nil && ok {
// That update contained a peer we didn't know about;
// request full update