mirror of
https://github.com/romanz/electrs.git
synced 2025-02-23 14:50:45 +01:00
Allow --reindex-last-blocks to be larger than height
This commit is contained in:
parent
2d2544f502
commit
f288fd2116
1 changed files with 5 additions and 6 deletions
|
@ -58,13 +58,12 @@ impl Chain {
|
|||
if n == 0 {
|
||||
return;
|
||||
}
|
||||
if let Some(new_height) = self.height().checked_sub(n) {
|
||||
let new_height = self.height().saturating_sub(n);
|
||||
self.update(vec![NewHeader::from((
|
||||
self.headers[new_height].1,
|
||||
new_height,
|
||||
))])
|
||||
}
|
||||
}
|
||||
|
||||
/// Load the chain from a collecion of headers, up to the given tip
|
||||
pub(crate) fn load(&mut self, headers: Vec<BlockHeader>, tip: BlockHash) {
|
||||
|
|
Loading…
Add table
Reference in a new issue