server/peer.c: Engage the interval timer only while there are peers.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 19 May 2018 20:54:22 +0000 (21:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 25 Jan 2019 12:10:32 +0000 (12:10 +0000)
commit024d189a07d05a71117e35c0fde86fe0e6b89f7d
treef9a1ea4dec3f7644633036df8d9e9c5419806013
parentc9aded9f1c5c6eea294bf85e5e34efb9f52138c6
server/peer.c: Engage the interval timer only while there are peers.

The reason we need the interval timer is (a) to top up the entropy pool,
and (b) to clean up old keysets.  If there are no peers, we do no key
exchange, so we don't need any random bits, and there are no keysets to
clear away.  So we can save wakeups in this case.

For now, there are stub versions of `iv_(add|rm)reason' in `test.c', but
these will vanish once we split `main' out into its own file.  (Spoiler
alert!)
server/peer.c
server/test.c
server/tripe.c