aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2016-05-14 19:41:37 +0000
committerJulius Bünger <buenger@mytum.de>2016-05-14 19:41:37 +0000
commit24d2c11a025e4a96d7fc0cb1ff4f4537e2003026 (patch)
tree23dbeead26eec9d3380f346a94e1a67084c4c6e1 /src/rps/gnunet-service-rps.c
parentda72f158c616fe40c5b254e5db78ef5884a0f525 (diff)
downloadgnunet-24d2c11a025e4a96d7fc0cb1ff4f4537e2003026.tar.gz
gnunet-24d2c11a025e4a96d7fc0cb1ff4f4537e2003026.zip
rps: use stored peers at startup
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index c7cdccdfb..f56627a54 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -698,7 +698,6 @@ got_peer (const struct GNUNET_PeerIdentity *peer)
698 } 698 }
699} 699}
700 700
701
702/** 701/**
703 * @brief Checks if there is a sending channel and if it is needed 702 * @brief Checks if there is a sending channel and if it is needed
704 * 703 *
@@ -2019,6 +2018,31 @@ init_peer_cb (void *cls,
2019 } 2018 }
2020} 2019}
2021 2020
2021/**
2022 * @brief Iterator function over stored, valid peers.
2023 *
2024 * We initialise the sampler with those.
2025 *
2026 * @param cls the closure
2027 * @param peer the peer id
2028 * @return #GNUNET_YES if we should continue to
2029 * iterate,
2030 * #GNUNET_NO if not.
2031 */
2032static int
2033valid_peers_iterator (void *cls,
2034 const struct GNUNET_PeerIdentity *peer)
2035{
2036 if (NULL != peer)
2037 {
2038 LOG (GNUNET_ERROR_TYPE_DEBUG,
2039 "Got stored, valid peer %s\n",
2040 GNUNET_i2s (peer));
2041 got_peer (peer);
2042 }
2043 return GNUNET_YES;
2044}
2045
2022 2046
2023/** 2047/**
2024 * Iterator over peers from peerinfo. 2048 * Iterator over peers from peerinfo.
@@ -2316,6 +2340,8 @@ run (void *cls,
2316 GNUNET_CADET_get_peers (cadet_handle, &init_peer_cb, NULL); 2340 GNUNET_CADET_get_peers (cadet_handle, &init_peer_cb, NULL);
2317 // TODO send push/pull to each of those peers? 2341 // TODO send push/pull to each of those peers?
2318 // TODO read stored valid peers from last run 2342 // TODO read stored valid peers from last run
2343 LOG (GNUNET_ERROR_TYPE_DEBUG, "Requesting stored valid peers\n");
2344 Peers_get_valid_peers (valid_peers_iterator, NULL);
2319 2345
2320 peerinfo_notify_handle = GNUNET_PEERINFO_notify (cfg, 2346 peerinfo_notify_handle = GNUNET_PEERINFO_notify (cfg,
2321 GNUNET_NO, 2347 GNUNET_NO,