summaryrefslogtreecommitdiff
path: root/toxcore/onion.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-05-01 15:46:48 -0400
committerirungentoo <irungentoo@gmail.com>2015-05-01 15:46:48 -0400
commitbd67129c3e532a97d13c7ed04541ecefc395ab5a (patch)
tree349afc587a5f73a6eb42f4d544c970b583ce7157 /toxcore/onion.c
parent7d13f1928e604b87c29ca22d8bf14e962c1cc8ed (diff)
Added a define for the length of onion paths.
Diffstat (limited to 'toxcore/onion.c')
-rw-r--r--toxcore/onion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/onion.c b/toxcore/onion.c
index 48e4c769..cec178b9 100644
--- a/toxcore/onion.c
+++ b/toxcore/onion.c
@@ -104,7 +104,7 @@ static int ipport_unpack(IP_Port *target, const uint8_t *data, unsigned int data
104 104
105/* Create a new onion path. 105/* Create a new onion path.
106 * 106 *
107 * Create a new onion path out of nodes (nodes is a list of 3 nodes) 107 * Create a new onion path out of nodes (nodes is a list of ONION_PATH_LENGTH nodes)
108 * 108 *
109 * new_path must be an empty memory location of atleast Onion_Path size. 109 * new_path must be an empty memory location of atleast Onion_Path size.
110 * 110 *
@@ -148,7 +148,7 @@ int create_onion_path(const DHT *dht, Onion_Path *new_path, const Node_format *n
148 */ 148 */
149int onion_path_to_nodes(Node_format *nodes, unsigned int num_nodes, const Onion_Path *path) 149int onion_path_to_nodes(Node_format *nodes, unsigned int num_nodes, const Onion_Path *path)
150{ 150{
151 if (num_nodes < 3) 151 if (num_nodes < ONION_PATH_LENGTH)
152 return -1; 152 return -1;
153 153
154 nodes[0].ip_port = path->ip_port1; 154 nodes[0].ip_port = path->ip_port1;