Permalink
Browse files

xnsub fix

- #xnsub detection regardless of letter case
- ".nicehash.com" auto xnsub enable
  • Loading branch information...
1 parent b326292 commit 468d06a8031abc25f25ce22595c3fd0d6f15d637 @nicehashdev nicehashdev committed Aug 6, 2015
Showing with 9 additions and 13 deletions.
  1. +9 −13 util.c
View
@@ -1645,19 +1645,15 @@ double tdiff(struct timeval *end, struct timeval *start)
void check_extranonce_option(struct pool *pool, char * url)
{
- char extra_op[16],*extra_op_loc;
- extra_op_loc = strstr(url,"#");
- if(extra_op_loc && !pool->extranonce_subscribe)
- {
- strcpy(extra_op, extra_op_loc);
- *extra_op_loc = '\0';
- if(!strcmp(extra_op,"#xnsub"))
- {
- pool->extranonce_subscribe = true;
- applog(LOG_DEBUG, "Pool %d extranonce subscribe enabled.", pool->pool_no);
- }
- }
- return;
+ int i;
+
+ for (i = 0; url[i]; i++) url[i] = tolower(url[i]);
+
+ if (strstr(url, ".nicehash.com") || strstr(url, "#xnsub"))
+ {
+ pool->extranonce_subscribe = true;
+ applog(LOG_DEBUG, "Pool %d extranonce subscribe enabled.", pool->pool_no);
+ }
}
bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port)

0 comments on commit 468d06a

Please sign in to comment.