This is a crucial piece of code that figures out which chain is correct if 1 or more blocks arrive that have a greater proof of work than your current best chain.
As far as I saw the whole blockhain is serialized and sent to the peers, so taking care of chair reorgs is trivial (and done in the video). What's really missing is difficulty retargeting.