From 3f4cc4535d5ff4a48bfb4b22504f53018091110f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6=20Fahlke?= Date: Tue, 14 Jan 2014 23:28:25 +0000 Subject: [PATCH 1/3] Explicitly initialize members of fundamental types; avoids "jump depends on uninitialized value"-warnings by valgrind. --- src/wallet.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet.h b/src/wallet.h index 428fcdd7..e8ea75ff 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -98,6 +98,7 @@ public: nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; + nTimeFirstKey = 0; } CWallet(std::string strWalletFileIn) { @@ -108,6 +109,7 @@ public: nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; + nTimeFirstKey = 0; } std::map mapWallet; From 8631460293d4cab545119c9606e9257dcc46122a Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Wed, 15 Jan 2014 08:47:05 -0200 Subject: [PATCH 2/3] reduce MIN_CORE_FILEDESCRIPTORS again, now that we have a single leveldb for all torrents. MIN_CORE_FILEDESCRIPTORS can't be much higher because it will limit nMaxConnections. --- src/clientversion.h | 2 +- src/init.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clientversion.h b/src/clientversion.h index 7c08a495..81137801 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -8,7 +8,7 @@ // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 -#define CLIENT_VERSION_REVISION 03 +#define CLIENT_VERSION_REVISION 04 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build diff --git a/src/init.cpp b/src/init.cpp index 9985967e..808930a1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -51,7 +51,7 @@ CClientUIInterface uiInterface; // anyway. #define MIN_CORE_FILEDESCRIPTORS 0 #else -#define MIN_CORE_FILEDESCRIPTORS 1000 +#define MIN_CORE_FILEDESCRIPTORS 500 #endif // Used to pass flags to the Bind() function From 25128d93dd8c51605037d2539fbdba640cfab086 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Wed, 15 Jan 2014 14:00:39 -0200 Subject: [PATCH 3/3] refresh mention resource in dht --- .../include/libtorrent/kademlia/node.hpp | 2 +- .../include/libtorrent/session_settings.hpp | 2 +- libtorrent/src/kademlia/node.cpp | 25 ++++++++++--------- src/clientversion.h | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/libtorrent/include/libtorrent/kademlia/node.hpp b/libtorrent/include/libtorrent/kademlia/node.hpp index 231c8c3f..ad383e76 100644 --- a/libtorrent/include/libtorrent/kademlia/node.hpp +++ b/libtorrent/include/libtorrent/kademlia/node.hpp @@ -295,7 +295,7 @@ private: ptime m_last_tracker_tick; ptime m_next_storage_refresh; - node_id m_last_refreshed_item; + std::pair m_last_refreshed_item; // secret random numbers used to create write tokens int m_secret[2]; diff --git a/libtorrent/include/libtorrent/session_settings.hpp b/libtorrent/include/libtorrent/session_settings.hpp index 9b064e98..ce135dbd 100644 --- a/libtorrent/include/libtorrent/session_settings.hpp +++ b/libtorrent/include/libtorrent/session_settings.hpp @@ -990,7 +990,7 @@ namespace libtorrent , max_fail_count(20) , max_torrents(2000) , max_dht_items(700) - , max_entries_per_multi(50) + , max_entries_per_multi(32) , max_torrent_search_reply(20) , restrict_routing_ips(true) , restrict_search_ips(true) diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index 6633b7d4..c0f65e47 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -497,15 +497,16 @@ bool node_impl::refresh_storage() { for (dht_storage_table_t::const_iterator i = m_storage_table.begin(), end(m_storage_table.end()); i != end; ++i ) { - if( i->first == m_last_refreshed_item ) { - refresh_next_item = true; - num_refreshable++; - continue; - } - dht_storage_list_t const& lsto = i->second; - if( lsto.size() == 1 ) { - dht_storage_item const& item = lsto.front(); + dht_storage_list_t::const_iterator j(lsto.begin()), jEnd(lsto.end()); + for(int jIdx = 0; j != jEnd; ++j, ++jIdx ) { + dht_storage_item const& item = *j; + + if( std::make_pair(i->first,jIdx) == m_last_refreshed_item ) { + refresh_next_item = true; + num_refreshable++; + continue; + } #ifdef ENABLE_DHT_ITEM_EXPIRE if( has_expired(item) ) { @@ -524,13 +525,13 @@ bool node_impl::refresh_storage() { std::string resource = target->dict_find_string_value("r"); bool multi = (target->dict_find_string_value("t") == "m"); - // refresh only signed single posts - if( !multi ) { + // refresh only signed single posts and mentions + if( !multi || (multi && resource == "mention") ) { num_refreshable++; if( refresh_next_item ) { refresh_next_item = false; - m_last_refreshed_item = i->first; + m_last_refreshed_item = std::make_pair(i->first,jIdx); #ifdef TORRENT_DHT_VERBOSE_LOGGING printf("node dht: refreshing storage: [%s,%s,%s]\n", username.c_str(), @@ -555,7 +556,7 @@ bool node_impl::refresh_storage() { } if( !did_something && m_storage_table.size() ) { - m_last_refreshed_item = m_storage_table.begin()->first; + m_last_refreshed_item = std::make_pair(m_storage_table.begin()->first,0); } time_duration sleepToRefresh; diff --git a/src/clientversion.h b/src/clientversion.h index 81137801..3e26d08a 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -8,7 +8,7 @@ // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 -#define CLIENT_VERSION_REVISION 04 +#define CLIENT_VERSION_REVISION 05 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build