diff options
-rw-r--r-- | testing/nTox.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 33c8ab85..a9af5239 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -667,10 +667,19 @@ int main(int argc, char *argv[]) | |||
667 | new_lines(whoami); | 667 | new_lines(whoami); |
668 | } | 668 | } |
669 | 669 | ||
670 | time_t timestamp0 = time(NULL); | ||
670 | while (1) { | 671 | while (1) { |
671 | if (on == 0 && tox_isconnected(m)) { | 672 | if (on == 0) { |
672 | new_lines("[i] connected to DHT"); | 673 | if (tox_isconnected(m)) { |
673 | on = 1; | 674 | new_lines("[i] connected to DHT"); |
675 | on = 1; | ||
676 | } else { | ||
677 | time_t timestamp1 = time(NULL); | ||
678 | if (timestamp0 + 10 < timestamp1) { | ||
679 | timestamp0 = timestamp1; | ||
680 | tox_bootstrap_from_address(m, argv[argvoffset + 1], ipv6enabled, port, binary_string); | ||
681 | } | ||
682 | } | ||
674 | } | 683 | } |
675 | 684 | ||
676 | tox_do(m); | 685 | tox_do(m); |