Browse Source

Merge remote-tracking branch 'cgminer/stratum' into stratum

Conflicts:
	README
	miner.c
Luke Dashjr 13 years ago
parent
commit
35a79acbc5
2 changed files with 9 additions and 2 deletions
  1. 4 1
      README
  2. 5 1
      miner.c

+ 4 - 1
README

@@ -138,6 +138,7 @@ Options for both config file and command line:
 --debuglog          Enable debug logging
 --expiry|-E <arg>   Upper bound on how many seconds after getting work we consider a share from it stale (default: 120)
 --failover-only     Don't leak work to backup pools when primary pool is lagging
+--fix-protocol      Do not redirect to a different getwork protocol (eg. stratum)
 --kernel-path|-K <arg> Specify a path to where bitstream and kernel files are (default: "/usr/local/bin")
 --load-balance      Change multipool strategy from failover to efficiency based balance
 --log|-l <arg>      Interval in seconds between log output (default: 5)
@@ -932,7 +933,9 @@ Stratum uses direct TCP connections to the pool and thus it will NOT currently
 work through a http proxy but will work via a socks proxy if you need to use
 one. If you input the stratum port directly into your configuration, or use the
 special prefix "stratum+tcp://" instead of "http://", BFGMiner will ONLY try to
-use stratum protocol mining.
+use stratum protocol mining. If you do NOT wish BFGMiner to automatically
+switch to stratum protocol even if it is detected, add one of the --no-stratum
+or --fix-protocol options.
 
 ---
 

+ 5 - 1
miner.c

@@ -156,6 +156,7 @@ static bool opt_submit_stale = true;
 static int opt_shares;
 static int opt_submit_threads = 0x40;
 bool opt_fail_only;
+static bool opt_fix_protocol;
 bool opt_autofan;
 bool opt_autoengine;
 bool opt_noadl;
@@ -1083,6 +1084,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--failover-only",
 			opt_set_bool, &opt_fail_only,
 			"Don't leak work to backup pools when primary pool is lagging"),
+	OPT_WITHOUT_ARG("--fix-protocol",
+			opt_set_bool, &opt_fix_protocol,
+			"Do not redirect to a different getwork protocol (eg. stratum)"),
 #ifdef HAVE_OPENCL
 	OPT_WITH_ARG("--gpu-dyninterval",
 		     set_int_1_to_65535, opt_show_intval, &opt_dynamic_interval,
@@ -5152,7 +5156,7 @@ tryagain:
 
 	/* Detect if a http getwork pool has an X-Stratum header at startup,
 	 * and if so, switch to that in preference to getwork if it works */
-	if (pool->stratum_url && want_stratum && (pool->has_stratum || stratum_works(pool))) {
+	if (pool->stratum_url && !opt_fix_protocol && want_stratum && (pool->has_stratum || stratum_works(pool))) {
 		curl_easy_cleanup(curl);
 
 		if (!pool->has_stratum) {