mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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.
This commit is contained in:
@@ -102,6 +102,15 @@ public:
|
||||
//! Return the number of (unique) addresses in all tables.
|
||||
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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user