mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 20:44:56 +00:00
report dht_global_nodes in getinfo
This commit is contained in:
parent
8cae4d84de
commit
6708cec239
@ -83,7 +83,9 @@ Value getinfo(const Array& params, bool fHelp)
|
||||
obj.push_back(Pair("addrman_total", (int)addrman.size()));
|
||||
obj.push_back(Pair("addrman_get", (int)addrman.GetAddr().size()));
|
||||
}
|
||||
obj.push_back(Pair("dht_nodes", getDhtNodes()));
|
||||
boost::int64_t dht_global_nodes;
|
||||
obj.push_back(Pair("dht_nodes", getDhtNodes(&dht_global_nodes)));
|
||||
obj.push_back(Pair("dht_global_nodes", dht_global_nodes));
|
||||
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
|
||||
{
|
||||
LOCK(cs_main);
|
||||
|
@ -350,11 +350,13 @@ void lockAndSaveUserData()
|
||||
}
|
||||
}
|
||||
|
||||
int getDhtNodes()
|
||||
int getDhtNodes(boost::int64_t *dht_global_nodes)
|
||||
{
|
||||
if( !ses )
|
||||
return 0;
|
||||
session_status ss = ses->status();
|
||||
if( dht_global_nodes )
|
||||
*dht_global_nodes = ss.dht_global_nodes;
|
||||
return ss.dht_nodes;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,6 @@ void receivedSpamMessage(std::string const &message, std::string const &user);
|
||||
int getBestHeight();
|
||||
bool shouldDhtResourceExpire(std::string resource, bool multi, int height);
|
||||
|
||||
int getDhtNodes();
|
||||
int getDhtNodes(boost::int64_t *dht_global_nodes = NULL);
|
||||
|
||||
#endif // TWISTER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user