summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-05-04 22:16:29 +0200
committerJesper Jensen <jesper@jnsn.dev>2025-05-04 22:16:29 +0200
commit7de1bafcab547d03eff5323f2af3f4e92bd95a83 (patch)
tree0955aaab04d146c751581c1dc88c28fcf78e4d3b
parentcae316c3dc72f127e9e98a71df3dcabad9ce30cb (diff)
Remove the duplicate resize hack
It turns out this problem also included a bunch of other data corruption issues. I don't really know how that got in there, but I don't think this was a data-structure issue. We should revert to an assert to crash hard. We now have some checks that should give us a warning closer to when the corruption happens next time.
-rw-r--r--src/peers.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/peers.c b/src/peers.c
index 4688738..9aff14b 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -74,11 +74,7 @@ static int resize(size_t new_size) {
struct peer_entry* new_entry = NULL;
find(new_table, new_size, &entry->key, &new_entry);
- if(new_entry->set) {
- // This should never happen but sometimes does
- dbg("WARN: Dropping duplicate peer table entry as part of resize");
- continue;
- }
+ assert(!new_entry->set);
*new_entry = *entry;
}