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

Fix runtime price-setting #19

Merged
merged 4 commits into from
Oct 26, 2018
Merged

Conversation

drozdziak1
Copy link

@drozdziak1 drozdziak1 commented Oct 25, 2018

This fixes the "fee" config value

you can set the fee via the socket or a config file like so:

fee <value>

value has to be within uint32_t bounds.

Yes, it was this simple [*]

The problem was an old name for the "fee" config value (used to be
"price") which was included in a parser if statement which would exclude
unrecognized keywords.
@@ -801,7 +801,7 @@ parse_option(int c, gnc_t gnc, void *closure, char *token)
strcmp(token, "diversity") != 0 &&
strcmp(token, "diversity-factor") != 0 &&
strcmp(token, "smoothing-half-life") != 0 &&
strcmp(token, "price") != 0)
Copy link
Author

Choose a reason for hiding this comment

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

FYI that's the crucial change, others are just improvements

configuration.c Outdated
unsigned int i;
c = getword(c, &t, gnc, closure);
if(c < -1)
return c;
errno = 0;
i = strtoul(t, &end, 0);
if(*end != '\0' || errno) {
if(!t || t[0] == '-' || *end != '\0' || errno) {

Choose a reason for hiding this comment

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

I'm out of the context but why we're downcasting unsigned long into unsigned int? Would it be possible to keep the type?

@drozdziak1 drozdziak1 merged commit fae24ac into althea-net:master Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants