Skip to content

Commit

Permalink
Merge pull request #79 from thenetrunna/master
Browse files Browse the repository at this point in the history
minor bug fixes
  • Loading branch information
thenetrunna authored Feb 19, 2024
2 parents 9f0ec27 + 812f698 commit 03f26a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/node/default-node-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ updater_frequency = 5 # seconds

[tunnel]
server = "tunnel.shog.ai"
enable = true
enable = false
8 changes: 8 additions & 0 deletions src/node/dht/dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ result_t add_new_peer(node_ctx_t *ctx, char *peer_host) {
result_t res_manifest = json_string_to_node_manifest(manifest_str);
node_manifest_t *manifest = PROPAGATE(res_manifest);

if (strcmp(manifest->node_id, ctx->manifest->node_id) == 0) {
return ERR("peer node_id is same as local node_id");
}

if (!valid_node_id(manifest)) {
free_node_manifest(manifest);
return ERR("peer manifest node_id invalid due to public key mismatch");
Expand Down Expand Up @@ -238,6 +242,10 @@ result_t add_new_peer(node_ctx_t *ctx, char *peer_host) {
if (strcmp(manifest->node_id, dht->items[i]->node_id) == 0) {
exists = true;
}

if (strcmp(manifest->public_host, dht->items[i]->host) == 0) {
exists = true;
}
}

free_dht(dht);
Expand Down
1 change: 1 addition & 0 deletions src/node/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ result_t run_node_server(node_ctx_t *ctx) {
":", tunnel_port, NULL);

ctx->config->network.public_host = new_public_host;
ctx->manifest->public_host = strdup(new_public_host);

LOG(INFO, "TUNNELED PUBLIC HOST: %s", ctx->config->network.public_host);
}
Expand Down

0 comments on commit 03f26a5

Please sign in to comment.