diff --git a/Network/Haskoin/Wallet/Server.hs b/Network/Haskoin/Wallet/Server.hs
--- a/Network/Haskoin/Wallet/Server.hs
+++ b/Network/Haskoin/Wallet/Server.hs
@@ -157,15 +157,16 @@
         merkleSync pool 500 notif
     -- Run a thread that will re-broadcast pending transactions
     broadcastPendingTxs pool = forever $ do
+        (hash, _) <- runSqlNodeT $ walletBestBlock
         -- Wait until we are synced
         atomicallyNodeT $ do
-            synced <- areBlocksSynced
+            synced <- areBlocksSynced hash
             unless synced $ lift retry
         -- Send an INV for those transactions to all peers
         broadcastTxs =<< runDBPool (getPendingTxs 0) pool
         -- Wait until we are not synced
         atomicallyNodeT $ do
-            synced <- areBlocksSynced
+            synced <- areBlocksSynced hash
             when synced $ lift retry
     processTx pool notif = awaitForever $ \tx -> lift $ do
         (_, newAddrs) <- runDBPool (importNetTx tx (Just notif)) pool
@@ -205,9 +206,7 @@
     (hash, _) <- runDBPool walletBestBlock pool
     $(logDebug) "Starting merkle batch download"
     -- Wait for a new block or a rescan
-    bestM <- runSqlNodeT $ getBlockByHash hash
-    let best = fromMaybe (error "Best wallet block not found") bestM
-    (action, source) <- merkleDownload best bSize
+    (action, source) <- merkleDownload hash bSize
     $(logDebug) "Received a merkle action and source. Processing the source..."
 
     -- Read and process the data from the source
diff --git a/haskoin-wallet.cabal b/haskoin-wallet.cabal
--- a/haskoin-wallet.cabal
+++ b/haskoin-wallet.cabal
@@ -1,5 +1,5 @@
 name:                  haskoin-wallet
-version:               0.3.0
+version:               0.3.1
 synopsis:
     Implementation of a Bitcoin SPV Wallet with BIP32 and multisig support.
 description:
