net: Providing an interface for mapLocalHost

Contributes to #564 by providing an interface for mapLocalHost
through net -> node interface -> clientModel. Later this value can be
read by GUI to show the local addresses.
This commit is contained in:
Jadi committed 2024-08-02 10:40:33 +03:30
1 parent 058af75874
commit a5d7aff867
6 files changed
+29

No files matched your search

+7
View File
@@ -123,6 +123,13 @@ int64_t ClientModel::getHeaderTipTime() const
return cachedBestHeaderTime;
}
std::map<CNetAddr, LocalServiceInfo> ClientModel::getNetLocalAddresses() const
{
return m_node.getNetLocalAddresses();
}
int ClientModel::getNumBlocks() const
{
if (m_cached_num_blocks == -1) {
+4
View File
@@ -13,12 +13,15 @@
#include <sync.h>
#include <uint256.h>
#include <netaddress.h>
class BanTableModel;
class CBlockIndex;
class OptionsModel;
class PeerTableModel;
class PeerTableSortProxy;
enum class SynchronizationState;
struct LocalServiceInfo;
namespace interfaces {
class Handler;
@@ -68,6 +71,7 @@ public:
//! Return number of connections, default is in- and outbound (total)
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
std::map<CNetAddr, LocalServiceInfo> getNetLocalAddresses() const;
int getNumBlocks() const;
uint256 getBestBlockHash() EXCLUSIVE_LOCKS_REQUIRED(!m_cached_tip_mutex);
int getHeaderTipHeight() const;