In cases where we have a reorganization, peers will send us the lowest header that matches our records in fastsync_headers
Because we were previously checking for entry at key = current_height + 1, case where alternative headers are sent was not handled (necessarily less than our own blockchain height)
if let Some(fastsync_header) was returning None, and none of the following logic was executing
Now, we take lowest entry from our sorted vector and use that height to fetch entry from queue
Reorganization case is now handled properly, and recursive loop case is fixed.
fastsync_headers
current_height + 1
, case where alternative headers are sent was not handled (necessarily less than our own blockchain height)if let Some(fastsync_header)
was returning None, and none of the following logic was executingsorted
vector and use that height to fetch entry from queue