Use connman passed to ThreadSendAlert() instead of g_connman global. (#1610)

There is no reason to use g_connman global variable in ThreadSendAlert()
because reference to CConnman instance is already passed to it as argument.

This was overlooked when refactoring sendalert module, it's time to fix it.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
This commit is contained in:
Oleg Girko 2017-09-05 11:53:28 +01:00 committed by UdjinM6
parent 5617aef079
commit 91ae0b712a

View File

@ -100,8 +100,8 @@ void ThreadSendAlert(CConnman& connman)
printf("ThreadSendAlert() : Sending alert\n"); printf("ThreadSendAlert() : Sending alert\n");
int nSent = 0; int nSent = 0;
{ {
g_connman->ForEachNode([&alert2, &nSent](CNode* pnode) { connman.ForEachNode([&alert2, &connman, &nSent](CNode* pnode) {
if (alert2.RelayTo(pnode, *g_connman)) if (alert2.RelayTo(pnode, connman))
{ {
printf("ThreadSendAlert() : Sent alert to %s\n", pnode->addr.ToString().c_str()); printf("ThreadSendAlert() : Sent alert to %s\n", pnode->addr.ToString().c_str());
nSent++; nSent++;