diff --git a/common/daemon.c b/common/daemon.c index f93fa1884..36c16938f 100644 --- a/common/daemon.c +++ b/common/daemon.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -146,6 +147,12 @@ void daemon_setup(const char *argv0, memleak_init(); #endif + /* We rely on libsodium for some of the crypto stuff, so we'd better + * not start if it cannot do its job correctly. */ + if (sodium_init() == -1) + errx(1, "Could not initialize libsodium. Maybe not enough entropy" + " available ?"); + /* We handle write returning errors! */ signal(SIGPIPE, SIG_IGN); wally_init(0);