diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-04 20:04:42 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2019-02-04 20:05:41 +0100 |
commit | bfbe42585e9b9a77623a95df54ec76adf91fccea (patch) | |
tree | a6b4a2e607d8862d9c37cdd2e5482d9a1d8981de | |
parent | 76deb30550b2492f9c8d9f0302da32025166e0c5 (diff) | |
parent | 107623c26c2113428446effaa24edb986a3e780c (diff) | |
download | bitcoin-bfbe42585e9b9a77623a95df54ec76adf91fccea.tar.xz |
Merge #15345: net: Correct comparison of addr count
107623c26c2113428446effaa24edb986a3e780c net: Correct comparison of addr count (Carl Dong)
Pull request description:
`LOCAL_NONE` is supposed to be an enum indicating the `nScore` of a
`LocalServiceInfo` rather than the count of an addr in `mapLocalHost`.
Tree-SHA512: a47a0859dd11c991d75b54e96b08c502e3d235f7a6522a2355053f377d05e7853483996919292f458d917a561b23951e6945d6bf0ff5a2f29513c477c640bdd2
-rw-r--r-- | src/net.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index be249b4466..bc9480cf70 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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; } |