From 7f9fde8c1d1e4d01c549ea1631aeab725a2ee7cb Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 9 May 2014 21:44:52 +0000 Subject: [PATCH] fixed stupid serialisation error causing routing matrix not to be loaded properly git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7357 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/grouter/grouteritems.cc | 2 +- libretroshare/src/grouter/p3grouter.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/grouter/grouteritems.cc b/libretroshare/src/grouter/grouteritems.cc index 5b967c0d4..9fac32b8b 100644 --- a/libretroshare/src/grouter/grouteritems.cc +++ b/libretroshare/src/grouter/grouteritems.cc @@ -450,7 +450,7 @@ uint32_t RsGRouterMatrixFriendListItem::serial_size() const { uint32_t s = 8 ; // header s += 4 ; // reverse_friend_indices.size() - s += RsFileHash::SIZE_IN_BYTES * reverse_friend_indices.size() ; // sha1 for published_key + s += RsPeerId::SIZE_IN_BYTES * reverse_friend_indices.size() ; // sha1 for published_key return s ; } diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index 1eaac1b30..902e2ce4d 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -553,7 +553,7 @@ std::set p3GRouter::computeRoutingFriends(const std::vector& int k=0; total=probas[0] ; while(total Friend " << i << ", between 0 and " << p-1 << ": chose k=" << k << ", peer=" << pids[k] << " with probability " << probas[k] << std::endl; + grouter_debug() << " => Friend " << i << ", between 0 and " << N-1 << ": chose k=" << k << ", peer=" << pids[k] << " with probability " << probas[k] << std::endl; #endif res.insert(k) ; @@ -772,6 +772,7 @@ void p3GRouter::handleRecvACKItem(RsGRouterACKItem *item) grouter_debug() << " ==> final weight : " << weight << std::endl; #endif _routing_matrix.addRoutingClue(it->second.destination_key,item->PeerId(),weight) ; + _changed = true ; } #ifdef GROUTER_DEBUG grouter_debug() << " Removing friend try for peer " << item->PeerId() << ". " << it->second.tried_friends.size() << " tries left." << std::endl;