Fix get_header_for_output for genesis (#2192)

This commit is contained in:
Ignotus Peverell 2018-12-20 13:52:45 -08:00 committed by GitHub
parent 5faeeedf65
commit cab438efcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;