FormatMoney cleanup
[novacoin.git] / src / addrman.h
index 5f5bf79..9aa167b 100644 (file)
@@ -239,6 +239,7 @@ protected:
 
     // Select several addresses at once.
     void GetAddr_(std::vector<CAddress> &vAddr);
+    void GetOnlineAddr_(std::vector<CAddrInfo> &vAddr);
 
     // Mark an entry as currently-connected-to.
     void Connected_(const CService &addr, int64_t nTime);
@@ -569,7 +570,7 @@ public:
     // Return the number of (unique) addresses in all tables.
     int size()
     {
-        return vRandom.size();
+        return (int) vRandom.size();
     }
 
     // Consistency check
@@ -665,6 +666,18 @@ public:
         return vAddr;
     }
 
+    std::vector<CAddrInfo> GetOnlineAddr()
+    {
+        Check();
+        std::vector<CAddrInfo> vAddr;
+        {
+            LOCK(cs);
+            GetOnlineAddr_(vAddr);
+        }
+        Check();
+        return vAddr;
+    }
+
     // Mark an entry as currently-connected-to.
     void Connected(const CService &addr, int64_t nTime = GetAdjustedTime())
     {