merkle_sync: fix message format — type after ns (match chat_sync)

This commit is contained in:
Evgeny committed 2026-07-25 20:56:05 +03:00
1 parent ecb03ca290
commit d512bacc81
1 file changed
+4 -3
+4 -3
View File
@@ -235,8 +235,8 @@ static int _send_hashes(struct merkle_sync* ms, uint64_t peer, const char* ns,
uint8_t* buf = u_malloc(max_sz);
if (!buf) return -1;
uint8_t* p = buf;
*p++ = 0x01; /* MS_MSG_HASHES */
*p++ = ch_len; memcpy(p, ns, ch_len); p += ch_len;
*p++ = 0x01; /* MS_MSG_HASHES */
*p++ = level;
*p++ = prefix_bytes; _prefix_write(p, prefix, prefix_bytes); p += prefix_bytes;
*p++ = (uint8_t)(is_data ? 1 : 0);
@@ -270,8 +270,8 @@ static int _send_batch(struct merkle_sync* ms, uint64_t peer, const char* ns,
uint8_t* buf = u_malloc(max_sz);
if (!buf) return -1;
uint8_t* p = buf;
*p++ = 0x03; /* MS_MSG_BATCH */
*p++ = ch_len; memcpy(p, ns, ch_len); p += ch_len;
*p++ = 0x03; /* MS_MSG_BATCH */
*p++ = (uint8_t)count;
for (int i = 0; i < count; i++) {
@@ -426,8 +426,9 @@ static void _handle_hashes(struct merkle_sync* ms, uint64_t peer, const char* ns
uint8_t* rbuf = u_malloc(rs);
if (rbuf) {
uint8_t* wr = rbuf;
*wr++ = 0x02; /* MS_MSG_REQUEST */ *wr++ = ch_len;
*wr++ = ch_len;
memcpy(wr, ns, ch_len); wr += ch_len;
*wr++ = 0x02; /* MS_MSG_REQUEST */
*wr++ = (uint8_t)rcount;
for (int i = 0; i < rcount; i++) {
*wr++ = requests[i].level;