Change from stating which peer we expect to be on the end of a connection to accepting any known peer

This commit is contained in:
Bryan Boreham committed 2014-09-08 14:07:42 +01:00
1 parent 0a94388f0a
commit 8b3e97b96a
4 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -190,7 +190,7 @@ func (peer *Peer) StartLocalPeer() {
go peer.queryLoop(queryChan)
}
func (peer *Peer) CreateConnection(peerAddr string, expectedName PeerName) error {
func (peer *Peer) CreateConnection(peerAddr string, acceptNewPeer bool) error {
if err := peer.checkConnectionLimit(); err != nil {
return err
}
@@ -216,7 +216,7 @@ func (peer *Peer) CreateConnection(peerAddr string, expectedName PeerName) error
return err
}
connRemote := NewRemoteConnection(peer, nil, tcpConn.RemoteAddr().String())
NewLocalConnection(connRemote, expectedName, tcpConn, udpAddr, peer.Router)
NewLocalConnection(connRemote, acceptNewPeer, tcpConn, udpAddr, peer.Router)
return nil
}