patch2.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 468d06a8031abc25f25ce22595c3fd0d6f15d637 Mon Sep 17 00:00:00 2001
  2. From: nicehashdev <info@nicehash.com>
  3. Date: Thu, 6 Aug 2015 11:43:45 +0200
  4. Subject: [PATCH] xnsub fix
  5. - #xnsub detection regardless of letter case
  6. - ".nicehash.com" auto xnsub enable
  7. ---
  8. util.c | 22 +++++++++-------------
  9. 1 file changed, 9 insertions(+), 13 deletions(-)
  10. diff --git a/util.c b/util.c
  11. index 52a3fe26f2..795c6bd622 100644
  12. --- a/util.c
  13. +++ b/util.c
  14. @@ -1645,19 +1645,15 @@ double tdiff(struct timeval *end, struct timeval *start)
  15. void check_extranonce_option(struct pool *pool, char * url)
  16. {
  17. - char extra_op[16],*extra_op_loc;
  18. - extra_op_loc = strstr(url,"#");
  19. - if(extra_op_loc && !pool->extranonce_subscribe)
  20. - {
  21. - strcpy(extra_op, extra_op_loc);
  22. - *extra_op_loc = '\0';
  23. - if(!strcmp(extra_op,"#xnsub"))
  24. - {
  25. - pool->extranonce_subscribe = true;
  26. - applog(LOG_DEBUG, "Pool %d extranonce subscribe enabled.", pool->pool_no);
  27. - }
  28. - }
  29. - return;
  30. + int i;
  31. +
  32. + for (i = 0; url[i]; i++) url[i] = tolower(url[i]);
  33. +
  34. + if (strstr(url, ".nicehash.com") || strstr(url, "#xnsub"))
  35. + {
  36. + pool->extranonce_subscribe = true;
  37. + applog(LOG_DEBUG, "Pool %d extranonce subscribe enabled.", pool->pool_no);
  38. + }
  39. }
  40. bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port)