It's not strictly necessary (it would get the lock either way), however, what is the use of a TRY_LOCK if a few lines before we do an actual LOCK() of the same lock? That's why I moved the TRY_LOCK up, so that if the try fails it won't do IsInitialBlockDownload either...