Fix shadowing of "addr"

This commit is contained in:
Alexander Block 2019-04-09 09:09:45 +02:00
parent 5bebdda71f
commit 93b1b3d732

View File

@ -2069,19 +2069,19 @@ void CConnman::ThreadOpenMasternodeConnections()
std::vector<CService> pending; std::vector<CService> pending;
for (const auto& group : masternodeQuorumNodes) { for (const auto& group : masternodeQuorumNodes) {
for (const auto& p : group.second) { for (const auto& p : group.second) {
auto& addr = p.first; auto& addr2 = p.first;
auto& proRegTxHash = p.second; auto& proRegTxHash = p.second;
if (!connectedNodes.count(addr) && !IsMasternodeOrDisconnectRequested(addr) && !connectedProRegTxHashes.count(proRegTxHash)) { if (!connectedNodes.count(addr2) && !IsMasternodeOrDisconnectRequested(addr2) && !connectedProRegTxHashes.count(proRegTxHash)) {
pending.emplace_back(addr); pending.emplace_back(addr2);
} }
} }
} }
if (!vPendingMasternodes.empty()) { if (!vPendingMasternodes.empty()) {
auto addr = vPendingMasternodes.front(); auto addr2 = vPendingMasternodes.front();
vPendingMasternodes.erase(vPendingMasternodes.begin()); vPendingMasternodes.erase(vPendingMasternodes.begin());
if (!connectedNodes.count(addr) && !IsMasternodeOrDisconnectRequested(addr)) { if (!connectedNodes.count(addr2) && !IsMasternodeOrDisconnectRequested(addr2)) {
pending.emplace_back(addr); pending.emplace_back(addr2);
} }
} }