diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index b41420de2..196e99231 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -630,6 +631,11 @@ int main(int argc, char *argv[]) struct timers *timers; const char *stop_response; struct htlc_in_map *unprocessed_htlcs; + struct rlimit nofile = {1024, 1024}; + + /*~ Make sure that we limit ourselves to something reasonable. Modesty + * is a virtue. */ + setrlimit(RLIMIT_NOFILE, &nofile); /*~ What happens in strange locales should stay there. */ setup_locale();