aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.h
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2022-11-29 17:16:26 -0500
committerMartin Zumsande <mzumsande@gmail.com>2023-01-26 18:11:13 -0500
commitd35595a78a4a6cae72d3204c1ec3f82f77a10d56 (patch)
tree65c2b6e89ebb2b15857638cb78eb3e21e023f232 /src/addrman.h
parentadc41cf3b22f8f168e88ce3ad5f27c1130f12beb (diff)
downloadbitcoin-d35595a78a4a6cae72d3204c1ec3f82f77a10d56.tar.xz
addrman: add function to return size by network and table
For now, the new functionality will be used in the context of querying fixed seeds. Other possible applications for future changes is the use in the context of making automatic connections to specific networks, or making more detailed info about addrman accessible via rpc.
Diffstat (limited to 'src/addrman.h')
-rw-r--r--src/addrman.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/addrman.h b/src/addrman.h
index 0f1f808fa1..1c7254b5d7 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -103,6 +103,15 @@ public:
size_t size() const;
/**
+ * Return size information about addrman.
+ *
+ * @param[in] net Select addresses only from specified network (nullopt = all)
+ * @param[in] in_new Select addresses only from one table (true = new, false = tried, nullopt = both)
+ * @return Number of unique addresses that match specified options.
+ */
+ size_t Size(std::optional<Network> net, std::optional<bool> in_new) const;
+
+ /**
* Attempt to add one or more addresses to addrman's new table.
*
* @param[in] vAddr Address records to attempt to add.