From 80a7408e4d17e0e388f2d45fb90c5524a5dd7c89 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Mon, 26 Jan 2015 15:52:02 +0100 Subject: Fix a crash (assert) when client set serial version < 24 in INIT When SER_FMT_VER_LOWEST is set to zero, then the test is stupid in INIT because all client works. In mapblock we check if client's serialization version is < 24, but if client sent serialization version < 24 (15 for example) the server set it and tried to send nodes, then BOOM To resolve the problem: * Create a different CLIENT_MIN_VERSION to handle this problem * Remove the exception * Use an assert in case of bad developer code --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index 2b5fe9b08..31b5041ed 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1366,7 +1366,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // Use the highest version supported by both int deployed = std::min(client_max, our_max); // If it's lower than the lowest supported, give up. - if(deployed < SER_FMT_VER_LOWEST) + if(deployed < SER_FMT_CLIENT_VER_LOWEST) deployed = SER_FMT_VER_INVALID; if(deployed == SER_FMT_VER_INVALID) -- cgit v1.2.3