Browse Source

Merge branch 'develop'

pull/287/head
kevin 10 years ago
parent
commit
1a7f73d71c
3 changed files with 12 additions and 4 deletions
  1. 2
      src/jconf.c
  2. 1
      src/jconf.h
  3. 13
      src/server.c

2
src/jconf.c

@ -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
src/jconf.h

@ -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);

13
src/server.c

@ -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;
}

Loading…
Cancel
Save