Fix a bug in DHT that caused panics sometimes

This commit is contained in:
Igor Katson 2021-10-10 10:45:58 +01:00
parent 6f2121e33f
commit d51acba9be

View file

@ -584,7 +584,7 @@ impl Stream for PeerStream {
.unwrap()
.get_index(pos)
.unwrap();
if pos < end {
if pos + 1 < end {
self.initial_peers_pos = Some((pos + 1, end));
}
self.absolute_stream_pos += 1;