From 4a2359302077a21a4fe0c117d39738f1c8755a3f Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 26 Jul 2026 18:44:45 +0300 Subject: [PATCH] member_sync: add merkle_sync_broadcast relay to other SYNCED sessions --- tools/chatgui/transport/member_sync.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/chatgui/transport/member_sync.c b/tools/chatgui/transport/member_sync.c index 3bc03ee8..eee05a49 100644 --- a/tools/chatgui/transport/member_sync.c +++ b/tools/chatgui/transport/member_sync.c @@ -222,11 +222,10 @@ static int _member_get_items(void* ctx, const char* ns, uint8_t level, static int _member_apply_items(void* ctx, const char* ns, uint64_t from_peer, const uint8_t* data, size_t len) { struct UTUN_INSTANCE* inst = (struct UTUN_INSTANCE*)ctx; - (void)from_peer; if (len < 2) return -1; uint16_t count; memcpy(&count, data, 2); - DEBUG_TRACE(DEBUG_CATEGORY_DB_SYNC, "%s: apply_items ns=%s count=%u", MS_ID, ns, count); + DEBUG_TRACE(DEBUG_CATEGORY_DB_SYNC, "%s: apply_items ns=%s count=%u from=%016llx", MS_ID, ns, count, (unsigned long long)from_peer); const uint8_t* mp = data + 2; size_t mrem = len - 2; for (uint16_t i = 0; i < count && mrem >= 148; i++) { @@ -281,6 +280,8 @@ static int _member_apply_items(void* ctx, const char* ns, uint64_t from_peer, DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: [ADDR_SYNC] member_sync recv ns=%s nid=0x%016llx ac=%d", MS_ID, ns, (unsigned long long)nid, ac); mp += consumed; mrem -= (size_t)consumed; } + if (count > 0) + merkle_sync_broadcast(inst, ns, from_peer, data, len); return 0; }