diff options
| author | Jesper Jensen <jesper@slashwin.dk> | 2021-09-25 21:04:29 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@slashwin.dk> | 2021-09-25 21:04:29 +0200 |
| commit | c46781095ec64fbc4f8cf6097ca70b594a68c583 (patch) | |
| tree | 902aa3ef642d603f54d6d62bc1f42b6b948619da /src/routing.c | |
| parent | b5127f1c7624f40437159f164ac8eabc50b65f74 (diff) | |
Add timeout
Diffstat (limited to 'src/routing.c')
| -rw-r--r-- | src/routing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routing.c b/src/routing.c index 64d5353..f26f1ba 100644 --- a/src/routing.c +++ b/src/routing.c @@ -136,7 +136,7 @@ bool routing_offer(struct nodeid* id, struct entry **dest) { uint16_t baseIndex = base_bucket(id); int8_t inBucketIndex = scan(baseIndex, id); - if(inBucketIndex == -1) { + if(inBucketIndex < 0) { // The bucket either already contains the node, or it has no more space return false; } @@ -210,7 +210,7 @@ void routing_oldest(struct entry** dest) { continue; } - if(difftime((*dest)->last, entry->last) > 0.0) { + if(difftime((*dest)->expire, entry->expire) > 0.0) { *dest = entry; } } |
