diff options
author | dimitri staessens <[email protected]> | 2017-09-19 17:47:26 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2017-09-19 18:46:13 +0200 |
commit | 1dcef3957393c0500b81d93ffacf573e78be9a51 (patch) | |
tree | cf29abf695c1d53251560433441c29af57333e4b /src/ipcpd/normal/dir.c | |
parent | 115431af51795dfd583e24a051a7749c58a900b3 (diff) | |
download | ouroboros-1dcef3957393c0500b81d93ffacf573e78be9a51.tar.gz ouroboros-1dcef3957393c0500b81d93ffacf573e78be9a51.zip |
ipcpd: Enroll DHT when creating dt connection
The DHT will now enroll or sync when a data transfer connection is
added. This avoids the need to create a temporary data transfer
connection during enrollment (and speeds it up considerably).
The notifier system was modified to take an opaque pointer to the
object that registers as a parameter.
Diffstat (limited to 'src/ipcpd/normal/dir.c')
-rw-r--r-- | src/ipcpd/normal/dir.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/ipcpd/normal/dir.c b/src/ipcpd/normal/dir.c index 6d04c66a..0d046cd6 100644 --- a/src/ipcpd/normal/dir.c +++ b/src/ipcpd/normal/dir.c @@ -39,8 +39,6 @@ #include <inttypes.h> #define KAD_B (hash_len(ipcpi.dir_hash_algo) * CHAR_BIT) -#define ENROL_RETR 6 -#define ENROL_INTV 1 struct dht * dht; @@ -72,22 +70,6 @@ int dir_bootstrap(void) { return 0; } -int dir_enroll(uint64_t addr) { - size_t retr = 0; - log_dbg("Enrolling directory with peer %" PRIu64 ".", addr); - while (dht_enroll(dht, addr)) { - if (retr++ == ENROL_RETR) - return -EPERM; - - log_dbg("Directory enrollment failed, retrying..."); - sleep(ENROL_INTV); - } - - log_info("Directory enrolled."); - - return 0; -} - int dir_reg(const uint8_t * hash) { return dht_reg(dht, hash); |