Revision fb49d822

View differences:

src/PeerSampler/ncast.c
37 37
  int counter;
38 38
  struct ncast_proto_context *tc;
39 39
  const struct nodeID **r;
40
  int first_ts;
40 41
};
41 42

  
42 43
static uint64_t gettime(void)
......
121 122
    return NULL;
122 123
  }
123 124

  
125
  context->first_ts = (max_timestamp + 1) / 2;
126
  // increase timestamp for initial message, since that is out of the normal cycle of the bootstrap peer
127
  ncast_proto_myentry_update(context->tc, NULL, context->first_ts, NULL, 0);
128

  
124 129
  return context;
125 130
}
126 131

  
......
156 161
    }
157 162

  
158 163
    context->counter++;
159
    if (context->counter == context->bootstrap_cycles) context->bootstrap = false;
164
    if (context->counter == context->bootstrap_cycles) {
165
      context->bootstrap = false;
166
      ncast_proto_myentry_update(context->tc, NULL , - context->first_ts, NULL, 0);  // reset the timestamp of our own ID, we are in normal cycle, we will not disturb the algorithm
167
    }
160 168

  
161 169
    remote_cache = entries_undump(buff + sizeof(struct topo_header), len - sizeof(struct topo_header));
162 170
    if (h->type == NCAST_QUERY) {

Also available in: Unified diff