diff --git a/src/db_sync.c b/src/db_sync.c index f261d1f3..52ebf521 100644 --- a/src/db_sync.c +++ b/src/db_sync.c @@ -1011,6 +1011,16 @@ static void db_handle_send_data(struct DB_SYNC_INSTANCE* si, uint64_t src, const db_cascade_from(si, fix_from); + for (int j = 0; j < si->peer_count; j++) { + if (si->peers[j].synced_pos >= fix_from && &si->peers[j] != sp) { + uint32_t old = si->peers[j].synced_pos; + si->peers[j].synced_pos = fix_from > 0 ? fix_from - 1 : 0; + DEBUG_DEBUG(DEBUG_CATEGORY_DB_SYNC, "sync [%s:%04llX] cascade changed chain from pos=%u → peer=%016llx synced_pos %u→%u", + SI_SHRT(si), (unsigned long long)(src >> 16), fix_from, + (unsigned long long)si->peers[j].node_id, old, si->peers[j].synced_pos); + } + } + if (sp && received > 0) sp->synced_pos = from + received - 1; uint32_t mc = db_count(si);