diff --git a/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java b/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
+++ b/core/src/main/java/com/google/bitcoin/store/PostgresFullPrunedBlockStore.java
@@ -222,7 +222,10 @@ public class PostgresFullPrunedBlockStore implements FullPrunedBlockStore {
             try {
                 if(!conn.getAutoCommit()) {
                     conn.rollback();
-                    conn.close();
+                }
+                conn.close();
+                if(conn == this.conn.get()) {
+                    this.conn.set(null);
                 }
             } catch (SQLException ex) {
                 throw new RuntimeException(ex);
close connection regardless of autocommit status and set conn to null