make the Router include the RouterConfig

rather than copying the bulk of it
This commit is contained in:
Matthias Radestock committed 2015-04-14 11:39:11 +01:00
1 parent 9b29d2ecc5
commit 798bfeb0a7
3 files changed
+16 -29

No files matched your search

+3 -2
View File
@@ -245,8 +245,9 @@ func (peer *LocalPeer) broadcastPeerUpdate(peers ...*Peer) {
}
func (peer *LocalPeer) checkConnectionLimit() error {
if 0 != peer.router.ConnLimit && peer.ConnectionCount() >= peer.router.ConnLimit {
return fmt.Errorf("Connection limit reached (%v)", peer.router.ConnLimit)
limit := peer.router.ConnLimit
if 0 != limit && peer.ConnectionCount() >= limit {
return fmt.Errorf("Connection limit reached (%v)", limit)
}
return nil
}