Skip to content

question about node_timeout() function? #51

@latelee

Description

@latelee

Hi! I am using & learning horst recently.But I found that the main display window never delete PR after timeout, I enable WIFI on my phone, then disable WIFI when I see it on display window, and wait for 60 sec, my phone mac address is still there.
I dig into the code and found something. It will delete node info using the code:
// node.c node_timeout() if (n->last_seen < (the_time.tv_sec - conf.node_timeout)) { //... }
last_seen is timestamp of the node:
// node.c copy_nodeinfo() n->last_seen = time(NULL);
the_time is current time:
clock_gettime(CLOCK_MONOTONIC, &the_time);
But, the_time.tv_sec is always smaller then n->last_seen, so it will not delete node info.

When I change
clock_gettime(CLOCK_MONOTONIC, &the_time);
to
clock_gettime(CLOCK_REALTIME, &the_time);
everything is OK.

Is there something wrong or just my misunderstanding of horst?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions