diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
+++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java
@@ -211,12 +211,12 @@ public class PeerGroup {
     }
 
     /** The maximum number of connections that we will create to peers. */
-    public void setMaxConnections(int maxConnections) {
+    public synchronized void setMaxConnections(int maxConnections) {
         this.maxConnections = maxConnections;
     }
 
     /** The maximum number of connections that we will create to peers. */
-    public int getMaxConnections() {
+    public synchronized int getMaxConnections() {
         return maxConnections;
     }
Make PeerGroup.maxConnections fully synchronized.