fix MWP: incremental Blake2b hashing, address count limit in

deserialization
This commit is contained in:
2026-02-11 14:21:23 -03:00
parent 137469c3e1
commit 30bad26e67
3 changed files with 31 additions and 25 deletions

View File

@@ -57,21 +57,21 @@ test "MWP: two P2P nodes complete hole punch on localhost" {
std.debug.print("Server has no connected peer\n", .{});
return error.SkipZigTest;
};
pair.server.registerDhtNodeId(bob_dht_id, server_view_of_client) catch {};
try pair.server.registerDhtNodeId(bob_dht_id, server_view_of_client);
// Register Alice's DHT ID on Bob's side
pair.client.registerDhtNodeId(alice_dht_id, client_view_of_server) catch {};
try pair.client.registerDhtNodeId(alice_dht_id, client_view_of_server);
// Add to DHT routing tables
var alice_addr = Address.init();
alice_addr.port = pair.server_port;
alice_addr.data = .{ .ipv4 = .{ .bytes = .{ 127, 0, 0, 1 } } };
pair.client.dhtAddPeer(alice_dht_id, alice_addr) catch {};
try pair.client.dhtAddPeer(alice_dht_id, alice_addr);
var bob_addr = Address.init();
bob_addr.port = pair.client_port;
bob_addr.data = .{ .ipv4 = .{ .bytes = .{ 127, 0, 0, 1 } } };
pair.server.dhtAddPeer(bob_dht_id, bob_addr) catch {};
try pair.server.dhtAddPeer(bob_dht_id, bob_addr);
// Let DHT stabilize
pair.updateBothN(10);