diff --git a/include/opendht/dht.h b/include/opendht/dht.h index e062f8efe13f0c536694f6593dc03ffa3d9cc70b..524e4f439bf9dcf63984a67e94a8500e7d87b039 100644 --- a/include/opendht/dht.h +++ b/include/opendht/dht.h @@ -240,13 +240,13 @@ public: * @param f a filter function used to prefilter values. */ void get(const InfoHash& key, GetCallback cb, DoneCallback donecb=nullptr, Value::Filter f = Value::AllFilter()); - void get(const InfoHash& key, GetCallback cb, DoneCallbackSimple donecb=nullptr, Value::Filter f = Value::AllFilter()) { + void get(const InfoHash& key, GetCallback cb, DoneCallbackSimple donecb, Value::Filter f = Value::AllFilter()) { get(key, cb, bindDoneCb(donecb), f); } void get(const InfoHash& key, GetCallbackSimple cb, DoneCallback donecb=nullptr, Value::Filter f = Value::AllFilter()) { get(key, bindGetCb(cb), donecb, f); } - void get(const InfoHash& key, GetCallbackSimple cb, DoneCallbackSimple donecb=nullptr, Value::Filter f = Value::AllFilter()) { + void get(const InfoHash& key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter f = Value::AllFilter()) { get(key, bindGetCb(cb), bindDoneCb(donecb), f); } diff --git a/src/dht.cpp b/src/dht.cpp index 3a0e1f79c99b243be0a75ee912ada4d906f50622..bf609fc58c8c86bdd47c549614229afbe9ea12d7 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -2531,6 +2531,10 @@ Dht::periodic(const uint8_t *buf, size_t buflen, if (now >= confirm_nodes_time) { bool soon = false; + if (searches.empty()) { + get(myid, GetCallbackSimple{}); + } + soon |= bucketMaintenance(buckets); soon |= bucketMaintenance(buckets6);