From cab438efcb6fb001ec981a52d99f7267634944dc Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Thu, 20 Dec 2018 13:52:45 -0800 Subject: [PATCH] Fix get_header_for_output for genesis (#2192) --- chain/src/chain.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chain/src/chain.rs b/chain/src/chain.rs index 70ab100ec..97e86ea9d 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -1139,6 +1139,9 @@ impl Chain { loop { let search_height = max - (max - min) / 2; let h = txhashset.get_header_by_height(search_height)?; + if search_height == 0 { + return Ok(h); + } let h_prev = txhashset.get_header_by_height(search_height - 1)?; if pos > h.output_mmr_size { min = search_height;