From c61f016b44b44222ca0e262c0d2c83684c20fec0 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 23 Nov 2013 10:04:43 -0200 Subject: [PATCH 1/3] reduce checkblocks even more for faster startup --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 1350fc11..c1542ded 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -245,7 +245,7 @@ std::string HelpMessage() strUsage += " -keypool= " + _("Set key pool size to (default: 100)") + "\n"; strUsage += " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n"; strUsage += " -salvagewallet " + _("Attempt to recover private keys from a corrupt twisterwallet.dat") + "\n"; - strUsage += " -checkblocks= " + _("How many blocks to check at startup (default: 48, 0 = all)") + "\n"; + strUsage += " -checkblocks= " + _("How many blocks to check at startup (default: 12, 0 = all)") + "\n"; strUsage += " -checklevel= " + _("How thorough the block verification is (0-4, default: 3)") + "\n"; strUsage += " -txindex " + _("Maintain a full transaction index (default: 0)") + "\n"; strUsage += " -loadblock= " + _("Imports blocks from external blk000??.dat file") + "\n"; @@ -755,7 +755,7 @@ bool AppInit2(boost::thread_group& threadGroup) uiInterface.InitMessage(_("Verifying blocks...")); if (!VerifyDB(GetArg("-checklevel", 3), - GetArg( "-checkblocks", 48))) { + GetArg( "-checkblocks", 12))) { strLoadError = _("Corrupted block database detected"); break; } From 0903a9e0eca1573a425f3e21c38c9ab7879b0ecc Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 23 Nov 2013 10:05:15 -0200 Subject: [PATCH 2/3] fix bug where "follow" failed for empty users (who followed no one) --- src/twister.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/twister.cpp b/src/twister.cpp index 090512a1..bc845416 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -1595,10 +1595,9 @@ Value follow(const Array& params, bool fHelp) string username = users[u].get_str(); torrent_handle h = startTorrentUser(username); - LOCK(cs_twister); - if( h.is_valid() && m_users.count(localUser) && - !m_users[localUser].m_following.count(username) ) { - m_users[localUser].m_following.insert(username); + if( h.is_valid() ) { + LOCK(cs_twister); + m_users[localUser].m_following.insert(username); } } From 77cfe2cd6cbac8a9d6c4132b21100d2c58d66d4b Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 23 Nov 2013 12:38:50 -0200 Subject: [PATCH 3/3] libtorrent fix: should prevent the infinite sequence of auto manager triggering --- libtorrent/src/torrent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index 3b7f62a8..b1200bec 100644 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -7136,7 +7136,8 @@ namespace libtorrent TORRENT_ASSERT(m_ses.is_network_thread()); if (m_allow_peers == b - && m_graceful_pause_mode == graceful) return; + && (m_graceful_pause_mode == graceful + || m_ses.is_paused()) ) return; m_allow_peers = b; if (!m_ses.is_paused())