mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 03:36:45 +02:00
Remove testnet specific code
Preparing for ngc merge
This commit is contained in:
@ -42,7 +42,7 @@
|
||||
extern struct user_settings *user_settings;
|
||||
|
||||
/* URL that we get the JSON encoded nodes list from. */
|
||||
#define NODES_LIST_URL 0 // This should be empty until NGC merges with mainnet
|
||||
#define NODES_LIST_URL "https://nodes.tox.chat/json"
|
||||
|
||||
#define DEFAULT_NODES_FILENAME "DHTnodes.json"
|
||||
|
||||
@ -79,29 +79,6 @@ extern struct user_settings *user_settings;
|
||||
/* Maximum allowable size of the nodes list */
|
||||
#define MAX_NODELIST_SIZE (MAX_RECV_CURL_DATA_SIZE)
|
||||
|
||||
// TODO(Jfreegman): Remove this before production
|
||||
static uint8_t const TESTNET_KEY[] = {
|
||||
0x79, 0xCA, 0xDA, 0x49, 0x74, 0xB0, 0x92, 0x6F,
|
||||
0x28, 0x6F, 0x02, 0x5C, 0xD5, 0xFF, 0xDF, 0x3E,
|
||||
0x65, 0x4A, 0x37, 0x58, 0xC5, 0x3E, 0x02, 0x73,
|
||||
0xEC, 0xFC, 0x4D, 0x12, 0xC2, 0x1D, 0xCA, 0x48,
|
||||
};
|
||||
|
||||
// TODO(Jfreegman): Remove this before production
|
||||
#define TESTNET_PORT 33445
|
||||
|
||||
#define TESTNET_IP "172.93.52.70"
|
||||
|
||||
static uint8_t const TESTNET_KEY2[] = {
|
||||
0x5E, 0x47, 0xBA, 0x1D, 0xC3, 0x91, 0x3E, 0xB2,
|
||||
0xCB, 0xF2, 0xD6, 0x4C, 0xE4, 0xF2, 0x3D, 0x8B,
|
||||
0xFE, 0x53, 0x91, 0xBF, 0xAB, 0xE5, 0xC4, 0x3C,
|
||||
0x5B, 0xAD, 0x13, 0xF0, 0xA4, 0x14, 0xCD, 0x77,
|
||||
};
|
||||
|
||||
#define TESTNET_PORT2 38445
|
||||
#define TESTNET_IP2 "tox.plastiras.org"
|
||||
|
||||
static struct Thread_Data {
|
||||
pthread_t tid;
|
||||
pthread_attr_t attr;
|
||||
@ -298,11 +275,6 @@ on_exit:
|
||||
*/
|
||||
static int update_DHT_nodeslist(const char *nodes_path)
|
||||
{
|
||||
if (NODES_LIST_URL == 0) { // TODO: Remove this when NGC merges with mainnet
|
||||
fprintf(stderr, "Skipping DHT Nodes list fetching (remove before production)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!nodeslist_needs_update(nodes_path)) {
|
||||
return 0;
|
||||
}
|
||||
@ -583,25 +555,6 @@ on_exit:
|
||||
*/
|
||||
int load_DHT_nodeslist(void)
|
||||
{
|
||||
// TODO(Jfreegman): Remove this before production
|
||||
fprintf(stderr, "Adding NGC testnet node - remove this before production\n");
|
||||
|
||||
struct Node *node = &Nodes.list[0];
|
||||
node->have_ip4 = true;
|
||||
node->port = TESTNET_PORT;
|
||||
memcpy(node->key, TESTNET_KEY, sizeof(TESTNET_KEY));
|
||||
memcpy(node->ip4, TESTNET_IP, sizeof(TESTNET_IP));
|
||||
|
||||
struct Node *node2 = &Nodes.list[1];
|
||||
node2->have_ip4 = true;
|
||||
node2->port = TESTNET_PORT2;
|
||||
memcpy(node2->key, TESTNET_KEY2, sizeof(TESTNET_KEY2));
|
||||
memcpy(node2->ip4, TESTNET_IP2, sizeof(TESTNET_IP2));
|
||||
|
||||
Nodes.count = 2;
|
||||
|
||||
#if 0
|
||||
|
||||
if (thread_data.active) {
|
||||
return -1;
|
||||
}
|
||||
@ -625,8 +578,6 @@ int load_DHT_nodeslist(void)
|
||||
return -5;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user