fix off by one in setup_height
@@ -236,7 +236,7 @@ impl ChainStore for ChainKVStore {
fn setup_height(&self, header: &BlockHeader, old_tip: &Tip) -> Result<(), Error> {
// remove headers ahead if we backtracked
for n in header.height..old_tip.height {
- self.delete_header_by_height(n)?;
+ self.delete_header_by_height(n + 1)?;
}
self.build_by_height_index(header, false)
}
