Check current admission before resuming dependent synchronization

This commit is contained in:
evgeny committed 2026-11-04 00:52:48 +01:00
1 parent 8201b075f4
commit a13a6e0941
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -766,9 +766,9 @@ static void cs_feedback_done(uint64_t peer, const char* channel, int result, voi
static void _on_member_sync_done(uint64_t peer, const char* ns, int result, void* arg) {
struct chat_sync* cs = (struct chat_sync*)arg;
if (result == MT_OK) {
if (result == MT_OK && cs && topo_group_chat_allowed(cs->inst, chat_channel_id(ns), peer)) {
cs_resume_db_sync(cs, ns);
if (cs && merkle_sync_start(cs->inst, MT_DATA_FEEDBACK, peer, ns, cs_feedback_done, cs) < 0)
if (merkle_sync_start(cs->inst, MT_DATA_FEEDBACK, peer, ns, cs_feedback_done, cs) < 0)
DEBUG_WARN(DEBUG_CATEGORY_CHAT_SYNC, "%s: feedback sync unavailable ch=%s peer=%016llx", CS_ID, ns, (unsigned long long)peer);
}
DEBUG_INFO(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_sync %s ns=%s peer=%016llx",
+1 -1
View File
@@ -770,7 +770,7 @@ int merkle_sync_register(struct UTUN_INSTANCE* inst, uint8_t dataset, const stru
struct merkle_sync* ms = inst ? inst->msync : NULL;
if (!ms || ms->datasets[dataset].ops || !ops || !ops->update_bucket_hash || !ops->get_page
|| (!ops->apply_items && !ops->apply_page && !ops->stage_page) || (ops->validate_request && !ops->begin_pull)
|| ((ops->begin_pull || ops->commit_pull || ops->abort_pull || ops->stage_page)
|| ((ops->begin_pull || ops->commit_pull || ops->abort_pull || ops->stage_page || ops->publish_pull)
&& !(ops->begin_pull && ops->commit_pull && ops->abort_pull && ops->stage_page))) {
DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "merkle_sync: invalid dataset registration dataset=%u", dataset); return -1;
}