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.5
+### Fixed
+- Handle special case in block header binary search function.
+
 ## 0.17.4
 ### Fixed
 - Bounds check too restrictive in block header binary search function.
diff --git a/haskoin-core.cabal b/haskoin-core.cabal
--- a/haskoin-core.cabal
+++ b/haskoin-core.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 168be8c79df03def3902c328ae1c29a5d4e2f77ba15072450acc9c17b2823eb5
+-- hash: 1ea170297fcc675501a164406d4103bae8feb08c641258580d099edabac6360c
 
 name:           haskoin-core
-version:        0.17.4
+version:        0.17.5
 synopsis:       Bitcoin & Bitcoin Cash library for Haskell
 description:    Please see the README on GitHub at <https://github.com/haskoin/haskoin-core#readme>
 category:       Bitcoin, Finance, Network
diff --git a/src/Haskoin/Block/Headers.hs b/src/Haskoin/Block/Headers.hs
--- a/src/Haskoin/Block/Headers.hs
+++ b/src/Haskoin/Block/Headers.hs
@@ -605,10 +605,18 @@
         r (a, a') (b, b') (m, m')
     r (a, a') (b, b') (m, m')
         | out_of_bounds a' b' = mzero
+        | select_first a' = return a
+        | select_last b' = return b
         | no_middle a b = choose_one a b
         | is_between a' m' = go a m
         | is_between m' b' = go m b
         | otherwise = mzero
+    select_first a'
+        | not top = a' /= LT
+        | otherwise = False
+    select_last b'
+        | top = b' /= GT
+        | otherwise = False
     out_of_bounds a' b'
         | top = a' == GT
         | otherwise = b' == LT
