diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@
 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
 
+## 0.17.12
+### Fixed
+- Do not connect to more than the maximum number of peers.
+
 ## 0.17.11
 ### Added
 - Display message command that disconnects a peer.
diff --git a/haskoin-node.cabal b/haskoin-node.cabal
--- a/haskoin-node.cabal
+++ b/haskoin-node.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 935bd495e75d0e687287d577b6fb7a4a196a1736124ee8bf09569d216a8735bc
+-- hash: 083f732d2e52665302507d77fe2ebfaa42823fd2648e9987889b6057360bf91f
 
 name:           haskoin-node
-version:        0.17.11
+version:        0.17.12
 synopsis:       P2P library for Bitcoin and Bitcoin Cash
 description:    Please see the README on GitHub at <https://github.com/haskoin/haskoin-node#readme>
 category:       Bitcoin, Finance, Network
diff --git a/src/Haskoin/Node/Manager.hs b/src/Haskoin/Node/Manager.hs
--- a/src/Haskoin/Node/Manager.hs
+++ b/src/Haskoin/Node/Manager.hs
@@ -520,7 +520,7 @@
     link a >> act
   where
     go = forever $ do
-        l <- length <$> getConnectedPeers
+        l <- length <$> getOnlinePeers
         x <- asks (peerManagerMaxPeers . myConfig)
         when (l < x) $
             getNewPeer >>= mapM_ (\sa -> ask >>= managerConnect sa)
