1010#include <common/json_param.h>
1111#include <common/json_stream.h>
1212#include <common/memleak.h>
13+ #include <common/timeout.h>
1314#include <errno.h>
1415#include <plugins/libplugin.h>
1516
@@ -1034,6 +1035,11 @@ static void parse_getnetworkinfo_result(struct plugin *p, const char *buf)
10341035 tal_free (result );
10351036}
10361037
1038+ static void log_warm_up (struct plugin * p )
1039+ {
1040+ plugin_log (p , LOG_UNUSUAL , "Waiting for bitcoind to warm up..." );
1041+ }
1042+
10371043static void wait_and_check_bitcoind (struct plugin * p )
10381044{
10391045 int in , from , status , ret ;
@@ -1042,8 +1048,6 @@ static void wait_and_check_bitcoind(struct plugin *p)
10421048 gather_args (bitcoind , "-rpcwait" , "getnetworkinfo" , NULL );
10431049 char * output = NULL ;
10441050
1045- // plugin_log(p, LOG_UNUSUAL, "Waiting for bitcoind to warm up...");
1046-
10471051 child = pipecmdarr (& in , & from , & from , cast_const2 (char * * , cmd ));
10481052
10491053 if (bitcoind -> rpcpass )
@@ -1084,6 +1088,10 @@ static void wait_and_check_bitcoind(struct plugin *p)
10841088 cmd [0 ], WEXITSTATUS (status ), output ));
10851089 }
10861090
1091+ struct timers * timer = tal (cmd , struct timers );
1092+ timers_init (timer , time_mono ());
1093+ new_reltimer (timer , timer , time_from_sec (30 ), log_warm_up , p );
1094+
10871095 parse_getnetworkinfo_result (p , output );
10881096
10891097 tal_free (cmd );
0 commit comments