diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2025-05-10 11:48:45 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2025-05-10 11:48:45 +0200 |
| commit | 444d0b3b783e458a3a55ffa19209ae6e8c86efc2 (patch) | |
| tree | 446a0f79335da46150f1e82ab3080bf5e8ed94fc /src | |
| parent | f93e2d4de6e8140276ce84d173bfb80acaf45830 (diff) | |
Remove the routing table rebuild
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 1 | ||||
| -rw-r--r-- | src/routing.c | 17 | ||||
| -rw-r--r-- | src/routing.h | 1 |
3 files changed, 0 insertions, 19 deletions
@@ -158,7 +158,6 @@ int main(int argc, char** argv) { } else { routing_setid(&myID); routing_reset_expire(time(NULL) + PROTO_UNCTM); - routing_rebuild_table(); } dht.self = myID; diff --git a/src/routing.c b/src/routing.c index 3ef418f..02b2f03 100644 --- a/src/routing.c +++ b/src/routing.c @@ -80,23 +80,6 @@ void routing_update_metrics() { } } -void routing_rebuild_table() { - struct entry table_swap[RT_SIZE]; - memcpy(table_swap, pTable->table, sizeof(pTable->table)); - routing_flush(); - - for(size_t i = 0; i < RT_SIZE; i++) { - if(!table_swap[i].set) continue; - - struct entry *entry; - if(routing_offer(&table_swap[i].id, &entry)) { - *entry = table_swap[i]; - } else { - dbg("Dropping a client since we already have enough in that bucket"); - } - } -} - void routing_flush() { memset(pTable->table, 0, sizeof(pTable->table)); } diff --git a/src/routing.h b/src/routing.h index a6d1e84..2d53b80 100644 --- a/src/routing.h +++ b/src/routing.h @@ -39,7 +39,6 @@ extern int table_size; void routing_init(struct nodeid* myid); void routing_setid(struct nodeid *id); void routing_update_metrics(); -void routing_rebuild_table(); void routing_flush(); bool routing_interested(struct nodeid* id); bool routing_offer(struct nodeid* id, struct entry **dest); |
