enum GNUNET_BLOCK_Type type;
};
+/**
+ * Identity of this peer.
+ */
+static struct GNUNET_PeerIdentity my_id;
/**
* Our connection to the datastore.
static struct GNUNET_TIME_Relative
get_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
+ if (atsi == NULL)
+ return GNUNET_TIME_UNIT_SECONDS;
while ( (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) &&
(ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY) )
atsi++;
uint32_t trust;
struct GNUNET_TIME_Relative latency;
+ if (0 == memcmp (&my_id, peer, sizeof (struct GNUNET_PeerIdentity)))
+ return;
latency = get_latency (atsi);
cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
&peer->hashPubKey);
struct MigrationReadyBlock *pos;
struct MigrationReadyBlock *next;
+ if (0 == memcmp (&my_id, peer, sizeof (struct GNUNET_PeerIdentity)))
+ return;
GNUNET_CONTAINER_multihashmap_get_multiple (peer_request_map,
&peer->hashPubKey,
&destroy_request,
/* **************************** Startup ************************ */
+
+
+/**
+ * Function called after GNUNET_CORE_connect has succeeded
+ * (or failed for good). Note that the private key of the
+ * peer is intentionally not exposed here; if you need it,
+ * your process should try to read the private key file
+ * directly (which should work if you are authorized...).
+ *
+ * @param cls closure
+ * @param server handle to the server, NULL if we failed
+ * @param my_identity ID of this peer, NULL if we failed
+ * @param publicKey public key of this peer, NULL if we failed
+ */
+static void
+peer_init_handler (void *cls,
+ struct GNUNET_CORE_Handle * server,
+ const struct GNUNET_PeerIdentity *
+ my_identity,
+ const struct
+ GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *
+ publicKey)
+{
+ my_id = *my_identity;
+}
+
+
+
+
/**
* Process fs requests.
*
core = GNUNET_CORE_connect (cfg,
1, /* larger? */
NULL,
- NULL,
+ &peer_init_handler,
&peer_connect_handler,
&peer_disconnect_handler,
&peer_status_handler,