summaryrefslogtreecommitdiff
path: root/core/DHT.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-07-16 19:45:20 -0400
committerirungentoo <irungentoo@gmail.com>2013-07-16 19:45:20 -0400
commitffa809b3797e1e8fba4c1c495c4990cae44477d7 (patch)
tree4aec372764715c161331ec6aa32f933057bc045b /core/DHT.c
parentbec416a05058ed821e9c16e3dda477abed41ec0d (diff)
ncurses test now tells you when you connect to the DHT.
Diffstat (limited to 'core/DHT.c')
-rw-r--r--core/DHT.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/DHT.c b/core/DHT.c
index 18f2de38..399d491b 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -1017,3 +1017,19 @@ int DHT_load(uint8_t * data, uint32_t size)
1017 } 1017 }
1018 return 0; 1018 return 0;
1019} 1019}
1020
1021//returns 0 if we are not connected to the DHT
1022//returns 1 if we are
1023int DHT_isconnected()
1024{
1025 uint32_t i;
1026 uint32_t temp_time = unix_time();
1027 for(i = 0; i < LCLIENT_LIST; i++)
1028 {
1029 if(close_clientlist[i].timestamp + BAD_NODE_TIMEOUT > temp_time)
1030 {
1031 return 1;
1032 }
1033 }
1034 return 0;
1035} \ No newline at end of file