From 8dbae988ecf81c3a7933188e5d0ee8cc03f62ae5 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 3 Dec 2013 18:35:28 -0200 Subject: [PATCH] dont expire dht items if block chain is invalid --- libtorrent/src/kademlia/node.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index 15993712..16c6917c 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -574,6 +574,10 @@ bool node_impl::refresh_storage() { } bool node_impl::has_expired(dht_storage_item const& item) { + // dont expire if block chain is invalid + if( getBestHeight() < 1 ) + return false; + if (!verifySignature(item.p, item.sig_user, item.sig_p)) { // invalid signature counts as expired printf("node_impl::has_expired verifySignature failed\n");