mirror of
https://github.com/romanz/electrs.git
synced 2025-02-24 23:08:39 +01:00
Make sure no block is skipped during parsing
This commit is contained in:
parent
5891133528
commit
2cf765ba5c
1 changed files with 4 additions and 1 deletions
|
@ -127,7 +127,10 @@ fn parse_blocks(blob: &[u8]) -> Result<Vec<Block>> {
|
|||
let pos = cursor.position();
|
||||
let mut decoder = RawDecoder::new(cursor);
|
||||
match decoder.read_u32().chain_err(|| "no magic")? {
|
||||
0 => break,
|
||||
0 => {
|
||||
cursor = decoder.into_inner(); // skip zeroes
|
||||
continue;
|
||||
}
|
||||
0xD9B4BEF9 => (),
|
||||
x => bail!("incorrect magic {:x} at {}", x, pos),
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue