net: Correct comparison of addr count

LOCAL_NONE is supposed to be an enum indicating the score of a
LocalServiceInfo rather than the count of an addr in mapLocalHost.
This commit is contained in:
Carl Dong 2019-02-04 13:12:20 -05:00
parent cf8aa5c76a
commit 107623c26c

View file

@ -174,8 +174,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
static int GetnScore(const CService& addr)
{
LOCK(cs_mapLocalHost);
if (mapLocalHost.count(addr) == LOCAL_NONE)
return 0;
if (mapLocalHost.count(addr) == 0) return 0;
return mapLocalHost[addr].nScore;
}