Write relay message to the network

This commit is contained in:
2026-01-19 12:51:43 -05:00
parent d7dedd243e
commit c66b95bf89
2 changed files with 9 additions and 3 deletions

View File

@@ -123,7 +123,7 @@ const Relay = struct {
pub fn toBytes(self: Relay, buf: []u8) []u8 {
var out: Writer = .fixed(buf);
out.writeInt(u16, @intFromEnum(PacketType.relay), .big) catch unreachable;
out.writeInt(u16, undefined, .big) catch unreachable; // Length field, but unread. Will switch to checksum
out.writeInt(u16, @intCast(self.payload.len), .big) catch unreachable; // Length field, but unread. Will switch to checksum
out.writeAll(&self.dest.bytes) catch unreachable;
out.writeAll(self.payload) catch unreachable;
return out.buffered();