mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-22 23:56:01 +00:00
add config option "bitcoin_list"
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user