toxon
/
ToxEcho
Archived
1
0
Fork 0

Bootstrap nodes

This commit is contained in:
Braiden Vasco 2015-07-25 23:08:43 +05:00
parent 8d0df5f5f8
commit 58e09d5329
1 changed files with 21 additions and 0 deletions

21
main.c
View File

@ -60,5 +60,26 @@ int main()
fclose(nodes_file);
for (int node_index = 0; node_index < NODES_COUNT; ++node_index) {
struct Node *const node = &nodes[node_index];
uint8_t key_bin[TOX_PUBLIC_KEY_SIZE];
for (int i = 0; i < TOX_PUBLIC_KEY_SIZE; ++i)
sscanf(&node->key[i * 2], "%2hhx", &key_bin[i]);
TOX_ERR_BOOTSTRAP err;
tox_bootstrap(tox, node->ip, node->port, key_bin, &err);
if (err != TOX_ERR_BOOTSTRAP_OK)
fprintf(stderr, "Failed to bootstrap (\"%s\", %d, \"%s\") with error code %d\n",
node->ip,
node->port,
node->key,
err
);
}
return 0;
}