diff --git a/libtorrent/include/libtorrent/kademlia/node.hpp b/libtorrent/include/libtorrent/kademlia/node.hpp index 085cd426..123f87c7 100644 --- a/libtorrent/include/libtorrent/kademlia/node.hpp +++ b/libtorrent/include/libtorrent/kademlia/node.hpp @@ -121,12 +121,12 @@ struct torrent_entry struct dht_storage_item { // FIXME: optimize so bdecode is not needed all the time - dht_storage_item() : p(), sig_p(), sig_user(), local_add_time(0), confirmed(false), next_refresh_time(0) {} + dht_storage_item() : p(), sig_p(), sig_user(), local_add_time(0), confirmed(true), next_refresh_time(0) {} dht_storage_item(std::string const &_p, lazy_entry const *_sig_p, lazy_entry const *_sig_user) : p(_p), sig_p(_sig_p->string_value()), sig_user(_sig_user->string_value()), - local_add_time(0), confirmed(false), next_refresh_time(0) {} + local_add_time(0), confirmed(true), next_refresh_time(0) {} dht_storage_item(std::string const &_p, std::string const &_sig_p, std::string const &_sig_user) - : p(_p), sig_p(_sig_p), sig_user(_sig_user), local_add_time(0), confirmed(false), next_refresh_time(0) {} + : p(_p), sig_p(_sig_p), sig_user(_sig_user), local_add_time(0), confirmed(true), next_refresh_time(0) {} std::string p; std::string sig_p; std::string sig_user; diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index 09006ab6..ac3d3ed8 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -474,6 +474,7 @@ void node_impl::putDataSigned(std::string const &username, std::string const &re dht_storage_item item(str_p, sig_p, sig_user); item.local_add_time = time(NULL); + item.confirmed = false; std::vector vbuf; bencode(std::back_inserter(vbuf), p["v"]); std::pair bufv = std::make_pair(vbuf.data(), vbuf.size()); @@ -749,9 +750,6 @@ void node_impl::load_storage(entry const* e) { entry const *confirmed( j->find_key("confirmed") ); if(confirmed) { item.confirmed = (bool) confirmed->integer(); - } else { - // compatibility with twister 0.9.22 and below - item.confirmed = true; } // just for printf for now