From a30f1b803229b15f0df50cb08fe51d298b468e1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sun, 24 Feb 2019 16:09:29 -0500
Subject: [PATCH] dht: make exportNodes const

---
 include/opendht/dht.h              | 2 +-
 include/opendht/dht_interface.h    | 2 +-
 include/opendht/dht_proxy_client.h | 2 +-
 include/opendht/securedht.h        | 2 +-
 src/dht.cpp                        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/opendht/dht.h b/include/opendht/dht.h
index 46da9994..e604aa05 100644
--- a/include/opendht/dht.h
+++ b/include/opendht/dht.h
@@ -261,7 +261,7 @@ public:
      * Get the list of good nodes for local storage saving purposes
      * The list is ordered to minimize the back-to-work delay.
      */
-    std::vector<NodeExport> exportNodes();
+    std::vector<NodeExport> exportNodes() const;
 
     std::vector<ValuesExport> exportValues() const;
     void importValues(const std::vector<ValuesExport>&);
diff --git a/include/opendht/dht_interface.h b/include/opendht/dht_interface.h
index 82b7bf85..e30fc120 100644
--- a/include/opendht/dht_interface.h
+++ b/include/opendht/dht_interface.h
@@ -181,7 +181,7 @@ public:
      * Get the list of good nodes for local storage saving purposes
      * The list is ordered to minimize the back-to-work delay.
      */
-    virtual std::vector<NodeExport> exportNodes() = 0;
+    virtual std::vector<NodeExport> exportNodes() const = 0;
 
     virtual std::vector<ValuesExport> exportValues() const = 0;
     virtual void importValues(const std::vector<ValuesExport>&) = 0;
diff --git a/include/opendht/dht_proxy_client.h b/include/opendht/dht_proxy_client.h
index 2dae2a68..71371e8b 100644
--- a/include/opendht/dht_proxy_client.h
+++ b/include/opendht/dht_proxy_client.h
@@ -235,7 +235,7 @@ public:
     void insertNode(const InfoHash&, const sockaddr*, socklen_t) { }
     void insertNode(const NodeExport&) { }
     std::pair<size_t, size_t> getStoreSize() const { return {}; }
-    std::vector<NodeExport> exportNodes() { return {}; }
+    std::vector<NodeExport> exportNodes() const { return {}; }
     std::vector<ValuesExport> exportValues() const { return {}; }
     void importValues(const std::vector<ValuesExport>&) {}
     std::string getStorageLog() const { return {}; }
diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h
index bc57f178..44251d02 100644
--- a/include/opendht/securedht.h
+++ b/include/opendht/securedht.h
@@ -168,7 +168,7 @@ public:
     void setStorageLimit(size_t limit = DEFAULT_STORAGE_LIMIT) override {
         dht_->setStorageLimit(limit);
     }
-    std::vector<NodeExport> exportNodes() override {
+    std::vector<NodeExport> exportNodes() const override {
         return dht_->exportNodes();
     }
     std::vector<ValuesExport> exportValues() const override {
diff --git a/src/dht.cpp b/src/dht.cpp
index e37c5808..d0ceda34 100644
--- a/src/dht.cpp
+++ b/src/dht.cpp
@@ -2056,7 +2056,7 @@ Dht::importValues(const std::vector<ValuesExport>& import)
 
 
 std::vector<NodeExport>
-Dht::exportNodes()
+Dht::exportNodes() const
 {
     const auto& now = scheduler.time();
     std::vector<NodeExport> nodes;
-- 
GitLab