Browse Source

RPC: Avoid exposing Coinbase-Sig when it isn't supported

Luke Dashjr 12 years ago
parent
commit
81b88e3157
2 changed files with 6 additions and 3 deletions
  1. 4 0
      api.c
  2. 2 3
      miner.c

+ 4 - 0
api.c

@@ -1323,7 +1323,9 @@ static void minerconfig(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 	root = api_add_int(root, "ScanTime", &opt_scantime, false);
 	root = api_add_int(root, "Queue", &opt_queue, false);
 	root = api_add_int(root, "Expiry", &opt_expiry, false);
+#if BLKMAKER_VERSION > 0
 	root = api_add_string(root, "Coinbase-Sig", opt_coinbase_sig, true);
+#endif
 
 	root = print_data(root, buf, isjson);
 	if (isjson)
@@ -2913,12 +2915,14 @@ static void setconfig(__maybe_unused SOCKETTYPE c, char *param, bool isjson, __m
 
 	*(comma++) = '\0';
 
+#if BLKMAKER_VERSION > 0
 	if (strcasecmp(param, "coinbase-sig") == 0) {
 		free(opt_coinbase_sig);
 		opt_coinbase_sig = strdup(comma);
 		strcpy(io_buffer, message(MSG_SETCONFIG, 1, param, isjson));
 		return;
 	}
+#endif
 
 	value = atoi(comma);
 	if (value < 0 || value > 9999) {

+ 2 - 3
miner.c

@@ -100,10 +100,9 @@ bool opt_protocol;
 static bool opt_benchmark;
 static bool want_longpoll = true;
 static bool want_gbt = true;
-#if BLKMAKER_VERSION < 1
-const
-#endif
+#if BLKMAKER_VERSION > 0
 char *opt_coinbase_sig;
+#endif
 bool have_longpoll;
 bool want_per_device_stats;
 bool use_syslog;