mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 12:34:24 +00:00
dont assume the DHT item storage is confirmed just because we got some results back,
compare the contents instead. should improve reliability of mentions.
This commit is contained in:
parent
5acee892e5
commit
c7e35d86a2
@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <boost/random.hpp>
|
||||
#include <boost/nondet_random.hpp>
|
||||
#include <boost/random/mersenne_twister.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "libtorrent/io.hpp"
|
||||
#include "libtorrent/bencode.hpp"
|
||||
@ -348,9 +349,21 @@ namespace
|
||||
|
||||
void putData_confirm(entry::list_type const& values_list, dht_storage_item& item)
|
||||
{
|
||||
if( !item.confirmed && !values_list.empty() ) {
|
||||
item.confirmed = true;
|
||||
item.next_refresh_time = getNextRefreshTime();
|
||||
if( !item.confirmed ) {
|
||||
BOOST_FOREACH(const entry &e, values_list) {
|
||||
entry const *sig_p = e.find_key("sig_p");
|
||||
if( sig_p && sig_p->type() == entry::string_t &&
|
||||
sig_p->string() == item.sig_p ) {
|
||||
item.confirmed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !item.confirmed && time(NULL) > item.local_add_time + 60*60*24*2 ) {
|
||||
item.confirmed = true; // force confirm by timeout
|
||||
}
|
||||
if( item.confirmed ) {
|
||||
item.next_refresh_time = getNextRefreshTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 24
|
||||
#define CLIENT_VERSION_REVISION 25
|
||||
#define CLIENT_VERSION_BUILD 0
|
||||
|
||||
// Set to true for release, false for prerelease or test build
|
||||
|
Loading…
x
Reference in New Issue
Block a user