From b3190037d970f1bedf6e9e5748cebdfe1fc84cd3 Mon Sep 17 00:00:00 2001 From: fsb4000 Date: Thu, 1 Jan 2015 09:00:40 +0600 Subject: [PATCH] Try more than the first address for a DNS -addnode. https://github.com/bitcoin/bitcoin/commit/f2bd6c28e6bddd75d56d580c28f45d2a8be065ab --- src/net.cpp | 4 ++-- src/util.h | 2 +- src/walletdb.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 4f8b565..b36bcce 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1446,7 +1446,7 @@ void ThreadOpenAddedConnections2(void* parg) } } } - while (true) + for (uint32_t i = 0; true; i++) { vector > vservConnectAddresses = vservAddressesToAdd; // Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry @@ -1466,7 +1466,7 @@ void ThreadOpenAddedConnections2(void* parg) BOOST_FOREACH(vector& vserv, vservConnectAddresses) { CSemaphoreGrant grant(*semOutbound); - OpenNetworkConnection(CAddress(*(vserv.begin())), &grant); + OpenNetworkConnection(CAddress(vserv[i % vserv.size()]), &grant); Sleep(500); if (fShutdown) return; diff --git a/src/util.h b/src/util.h index c233a0b..167dd0b 100644 --- a/src/util.h +++ b/src/util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/walletdb.h b/src/walletdb.h index c65d776..0766aa8 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -129,7 +129,7 @@ public: return Write(std::make_pair(std::string("watchs"), dest), '1'); } - bool CWalletDB::EraseWatchOnly(const CScript &dest) + bool EraseWatchOnly(const CScript &dest) { nWalletDBUpdated++; return Erase(std::make_pair(std::string("watchs"), dest)); -- 1.7.1