Browse Source

Add --no-gbt option so getblocktemplate can be disabled if it causes problems

Luke Dashjr 13 years ago
parent
commit
c2e2999445
2 changed files with 6 additions and 1 deletions
  1. 1 0
      README
  2. 5 1
      miner.c

+ 1 - 0
README

@@ -143,6 +143,7 @@ Options for both config file and command line:
 --log|-l <arg>      Interval in seconds between log output (default: 5)
 --monitor|-m <arg>  Use custom pipe cmd for output messages
 --net-delay         Impose small delays in networking to not overload slow routers
+--no-gbt            Disable getblocktemplate support
 --no-longpoll       Disable X-Long-Polling support
 --no-pool-disable   Do not automatically disable pools that continually reject shares
 --no-submit-stale   Don't submit shares if they are detected as stale

+ 5 - 1
miner.c

@@ -95,6 +95,7 @@ static char packagename[255];
 bool opt_protocol;
 static bool opt_benchmark;
 static bool want_longpoll = true;
+static bool want_gbt = true;
 bool have_longpoll;
 bool want_per_device_stats;
 bool use_syslog;
@@ -1043,6 +1044,9 @@ static struct opt_table opt_config_table[] = {
 			opt_hidden
 #endif
 	),
+	OPT_WITHOUT_ARG("--no-gbt",
+			opt_set_invbool, &want_gbt,
+			"Disable getblocktemplate support"),
 	OPT_WITHOUT_ARG("--no-longpoll",
 			opt_set_invbool, &want_longpoll,
 			"Disable X-Long-Polling support"),
@@ -4527,7 +4531,7 @@ static bool pool_active(struct pool *pool, bool pinging)
 
 	work = make_work();
 	work->pool = pool;
-	proto = PLP_GETBLOCKTEMPLATE;
+	proto = want_gbt ? PLP_GETBLOCKTEMPLATE : PLP_GETWORK;
 
 tryagain:
 	rpc_req = prepare_rpc_req(work, proto, NULL);