Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple pools via CLI #2422

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Multiple pools via CLI #2422

wants to merge 1 commit into from

Conversation

o2genum
Copy link
Contributor

@o2genum o2genum commented May 1, 2019

Supply multiple pools via CLI options by using pool-related options multiple times.

Better CLI options functionality makes xmr-stak easier to integrate, because command line parameters are generally easier to manage programmatically.

@psychocrypt psychocrypt self-requested a review May 1, 2019 19:27
@psychocrypt psychocrypt self-assigned this May 1, 2019
@@ -524,32 +531,38 @@ void executor::ex_main()
if(!cfg.tls)
dev_tls = false;

if(!xmrstak::params::inst().poolURL.empty() && xmrstak::params::inst().poolURL == cfg.sPoolAddr)
auto& pool_from_params = find_if(xmrstak::params::inst().pools.begin(), xmrstak::params::inst().pools.end(), [&cfg](const xmrstak::pool &pool_from_params) { return pool_from_params.poolURL == cfg.sPoolAddr; });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line produces an error in linux:

xmrstak/misc/executor.cpp:534:35: error: invalid initialization of non-const reference of type ‘__gnu_cxx::__normal_iterator<xmrstak::pool*, std::vector<xmrstak::pool> >&’ from an rvalue of type ‘__gnu_cxx::__normal_iterator<xmrstak::pool*, std::vector<xmrstak::pool> >’
   auto& pool_from_params = find_if(xmrstak::params::inst().pools.begin(), xmrstak::params::inst().pools.end(), [&cfg](const xmrstak::pool &pool_from_params) { return pool_from_params.poolURL == cfg.sPoolAddr; });
                            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using "auto" as variable type, compiler doesn't automatically use "const" qualifier, so in this case it should be "const auto&" for the line to be valid. It is always best to explicitly add "const" qualifier if the following code is not supposed to modify the variable contents, this will allow compiler to optimize the code better.

@psychocrypt
Copy link
Collaborator

I will move this PR release after the next, since I need first check the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants