Skip to content

Commit

Permalink
Use connman passed to ThreadSendAlert() instead of g_connman global. (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
OlegGirko authored and UdjinM6 committed Sep 5, 2017
1 parent 5617aef commit 91ae0b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sendalert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ void ThreadSendAlert(CConnman& connman)
printf("ThreadSendAlert() : Sending alert\n");
int nSent = 0;
{
g_connman->ForEachNode([&alert2, &nSent](CNode* pnode) {
if (alert2.RelayTo(pnode, *g_connman))
connman.ForEachNode([&alert2, &connman, &nSent](CNode* pnode) {
if (alert2.RelayTo(pnode, connman))
{
printf("ThreadSendAlert() : Sent alert to %s\n", pnode->addr.ToString().c_str());
nSent++;
Expand Down

0 comments on commit 91ae0b7

Please sign in to comment.