perf(disc): instantly lookup self in DHT (#314)

* perf(disc): instantly lookup self in DHT

* Update crates/net/discv4/src/lib.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Matthias Seitz
2022-12-02 16:22:45 +01:00
committed by Georgios Konstantopoulos
parent 12212ec91a
commit 1668313d55

View File

@ -319,12 +319,7 @@ impl Discv4Service {
None,
);
// delay the first lookup for a bit to give the bootstrap process a chance to resolve
// entries first
let self_lookup_interval = tokio::time::interval_at(
tokio::time::Instant::now() + config.ping_timeout / 2,
config.lookup_interval,
);
let self_lookup_interval = tokio::time::interval(config.lookup_interval);
let ping_interval = tokio::time::interval(config.ping_interval);