Check for info-hash match on handshake. Refactoring code