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.6.8
+### Changed
+- Further optimize coinbase after height checks.
+
 ## 0.6.7
 ### Changed
 - Impose restrictions on recursion for coinbase after height checks.
diff --git a/app/Main.hs b/app/Main.hs
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -289,7 +289,7 @@
             res <-
                 withSnapshot db $ \s -> do
                 let d = (db, defaultReadOptions {useSnapshot = Just s})
-                cbAfterHeight d 100 height txid
+                cbAfterHeight d 100000 height txid
             S.json $ object ["result" .= res]
         S.get "/transactions" $ do
             txids <- param "txids"
diff --git a/haskoin-store.cabal b/haskoin-store.cabal
--- a/haskoin-store.cabal
+++ b/haskoin-store.cabal
@@ -2,10 +2,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: db673c6b1202a70890532986a1332d88c3463356e623cf7e03853a905961700b
+-- hash: ccd67ad2ad06941bbac623fbc3d7133ab14bc89b0ea120648557071e3501d0d4
 
 name:           haskoin-store
-version:        0.6.7
+version:        0.6.8
 synopsis:       Storage and index for Bitcoin and Bitcoin Cash
 description:    Store blocks, transactions, and balances for Bitcoin or Bitcoin Cash, and make that information via REST API.
 category:       Bitcoin, Finance, Network
diff --git a/src/Haskoin/Store.hs b/src/Haskoin/Store.hs
--- a/src/Haskoin/Store.hs
+++ b/src/Haskoin/Store.hs
@@ -277,21 +277,26 @@
     -> TxHash
     -> m (Maybe Bool)
 cbAfterHeight _ 0 _ _ = return Nothing
-cbAfterHeight i d h t =
-    runMaybeT $ do
-        tx <- MaybeT $ getTransaction i t
+cbAfterHeight i d h t = runMaybeT $ snd <$> tst d t
+  where
+    tst 0 _ = MaybeT $ return Nothing
+    tst e x = do
+        let e' = e - 1
+        tx <- MaybeT $ getTransaction i x
         if any isCoinbase (transactionInputs tx)
-            then return $ blockRefHeight (transactionBlock tx) > h
+            then return (e', blockRefHeight (transactionBlock tx) > h)
             else case transactionBlock tx of
                      BlockRef {blockRefHeight = b}
-                         | b <= h -> return False
-                     _ -> do
-                         let ins =
-                                 nub $
-                                 map
-                                     (outPointHash . inputPoint)
-                                     (transactionInputs tx)
-                         or <$> mapM (MaybeT . cbAfterHeight i (d - 1) h) ins
+                         | b <= h -> return (e', False)
+                     _ ->
+                         r e' . nub $
+                         map (outPointHash . inputPoint) (transactionInputs tx)
+    r e [] = return (e, False)
+    r e (n:ns) = do
+        (e', s) <- tst e n
+        if s
+            then return (e', True)
+            else r e' ns
 
 -- Snatched from:
 -- https://github.com/cblp/conduit-merge/blob/master/src/Data/Conduit/Merge.hs
