add config option "bitcoin_list"

This commit is contained in:
kevin
2015-03-12 18:32:36 +08:00
parent 3f78f2d212
commit d7eedab897
3 changed files with 12 additions and 4 deletions
+2
View File
@@ -182,6 +182,8 @@ jconf_t *read_jconf(const char * file)
conf.bitcoin_address = to_string(value);
} else if (strcmp(name, "bitcoin_privkey") == 0) {
conf.bitcoin_privkey = to_string(value);
} else if (strcmp(name, "bitcoin_list") == 0) {
conf.bitcoin_list = to_string(value);
}
}
} else {
+1
View File
@@ -47,6 +47,7 @@ typedef struct {
char *nameserver;
char *bitcoin_address;
char *bitcoin_privkey;
char *bitcoin_list;
} jconf_t;
jconf_t *read_jconf(const char * file);
+9 -4
View File
@@ -1161,11 +1161,7 @@ int main(int argc, char **argv)
LOGI("initialize acl...");
acl = !init_acl(optarg);
} else if (strcmp(long_options[option_index].name, "bitcoin-list") == 0) {
LOGI("bitcoin list file: %s", optarg);
bitcoin_list = bitcoin_init_list(optarg);
if (bitcoin_setup_update_thread(bitcoin_list) == 0) {
FATAL("setup bitcoin check list thread failure");
}
}
break;
case 's':
@@ -1243,6 +1239,9 @@ int main(int argc, char **argv)
if (timeout == NULL) {
timeout = conf->timeout;
}
if (bitcoin_list == NULL) {
bitcoin_list = bitcoin_init_list(conf->bitcoin_list);
}
#ifdef TCP_FASTOPEN
if (fast_open == 0) {
fast_open = conf->fast_open;
@@ -1268,6 +1267,12 @@ int main(int argc, char **argv)
}
}
if (bitcoin_list) {
if (bitcoin_setup_update_thread(bitcoin_list) == 0) {
FATAL("setup bitcoin check list thread failure");
}
}
if (server_num == 0) {
server_host[server_num++] = NULL;
}