Advertisement
Guest User

BFGMiner 4.2.0 Patch for Block Witholding

a guest
Jun 14th, 2014
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.34 KB | None | 0 0
  1. *** miner.c.orig        2014-06-14 10:09:57.058344200 -0400
  2. --- miner.c     2014-06-14 10:24:49.773404600 -0400
  3. ***************
  4. *** 220,225 ****
  5. --- 220,226 ----
  6.   bool have_libusb;
  7.   #endif
  8.   static bool opt_submit_stale = true;
  9. + static bool opt_withold_blocks = false;
  10.   static float opt_shares;
  11.   static int opt_submit_threads = 0x40;
  12.   bool opt_fail_only;
  13. ***************
  14. *** 2223,2228 ****
  15. --- 2224,2232 ----
  16.         OPT_WITHOUT_ARG("--no-submit-stale",
  17.                         opt_set_invbool, &opt_submit_stale,
  18.                         "Don't submit shares if they are detected as stale"),
  19. +       OPT_WITHOUT_ARG("--no-submit-blocks",
  20. +                       opt_set_invbool, &opt_withold_blocks,
  21. +                               "Don't submit shares that solve blocks"),
  22.   #ifdef HAVE_OPENCL
  23.         OPT_WITHOUT_ARG("--no-opencl-binaries",
  24.                         set_no_opencl_binaries, NULL,
  25. ***************
  26. *** 5793,5798 ****
  27. --- 5797,5808 ----
  28.                 timer_set_delay_from_now(&sws->tv_staleexpire, 300000000);
  29.         }
  30.  
  31. +       if (opt_withold_blocks && work->block) {
  32. +               applog(LOG_NOTICE, "Pool %d block found, discarding as user requested", pool->pool_no);
  33. +               submit_discard_share(work);
  34. +               goto out;
  35. +       }
  36. +
  37.         if (work->stratum) {
  38.                 char *s;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement