Fix (and DRY) the conditionals before calling `peer_disconnected`