From b6ae08be6010d23a6fd809ca8d893f76c349e054 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 7 Jan 2026 16:08:02 +0700 Subject: [PATCH] route length is part of header length now --- bitchat/Protocols/BinaryProtocol.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitchat/Protocols/BinaryProtocol.swift b/bitchat/Protocols/BinaryProtocol.swift index f79f931d..0cc6f317 100644 --- a/bitchat/Protocols/BinaryProtocol.swift +++ b/bitchat/Protocols/BinaryProtocol.swift @@ -184,8 +184,8 @@ struct BinaryProtocol { if version == 2 && payloadDataSize > Int(UInt32.max) { return nil } guard let headerSize = headerSize(for: version) else { return nil } - let estimatedHeader = headerSize + senderIDSize + (packet.recipientID == nil ? 0 : recipientIDSize) - let estimatedPayload = payloadDataSize + routeLength + let estimatedHeader = headerSize + senderIDSize + (packet.recipientID == nil ? 0 : recipientIDSize) + routeLength + let estimatedPayload = payloadDataSize let estimatedSignature = (packet.signature == nil ? 0 : signatureSize) var data = Data() data.reserveCapacity(estimatedHeader + estimatedPayload + estimatedSignature + 255)