aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-10-02 11:29:35 -0400
committerMatt Corallo <git@bluematt.me>2016-10-31 10:08:11 -0400
commitd6ea737be19a0001e69e4e854eb1cef21523ea7a (patch)
treeef4b8d18a8c604db15a33314aead7f4c5e4ab583 /src/init.cpp
parentfc0c24f67b4323f215f908767b644bf022c7fe9a (diff)
downloadbitcoin-d6ea737be19a0001e69e4e854eb1cef21523ea7a.tar.xz
Remove network state wipe from UnloadBlockIndex.
UnloadBlockIndex is only used during init if we end up reindexing to clear our block state so that we can start over. However, at that time no connections have been brought up as CConnman hasn't been started yet, so all of the network processing state logic is empty when its called. Additionally, the initialization of the recentRejects set is moved to InitPeerLogic.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 84b0108ea8..0f42d907b9 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1100,6 +1100,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return false;
#endif
// ********************************************************* Step 6: network initialization
+ // Note that we absolutely cannot open any actual connections
+ // until the very end ("start node") as the UTXO/block state
+ // is not yet setup and may end up being set up twice if we
+ // need to reindex later.
assert(!g_connman);
g_connman = std::unique_ptr<CConnman>(new CConnman(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max())));