@@ -32,6 +32,8 @@ static LIMITER: OnceCell<RateLimiter<NotKeyed, InMemoryState, MonotonicClock>> =
3232 OnceCell :: const_new ( ) ;
3333
3434static RPC_CLIENT : OnceCell < Arc < Mutex < cln_rpc:: ClnRpc > > > = OnceCell :: const_new ( ) ;
35+ static RPC_POLL_INTERVAL : Duration = Duration :: from_millis ( 500 ) ;
36+
3537
3638pub async fn get_rpc < P : AsRef < Path > > ( path : P ) -> Arc < Mutex < cln_rpc:: ClnRpc > > {
3739 RPC_CLIENT
@@ -42,12 +44,9 @@ pub async fn get_rpc<P: AsRef<Path>>(path: P) -> Arc<Mutex<cln_rpc::ClnRpc>> {
4244 debug ! ( "Connected to lightning-rpc." ) ;
4345 return Arc :: new ( Mutex :: new ( client) ) ;
4446 }
45- Err ( e) => {
46- debug ! (
47- "Failed to connect to lightning-rpc: {:?}. Retrying in 50m..." ,
48- e
49- ) ;
50- tokio:: time:: sleep ( Duration :: from_millis ( 50 ) ) . await ;
47+ Err ( _) => {
48+ debug ! ( "Failed to connect to lightning-rpc. Retrying in {RPC_POLL_INTERVAL:?}..." ) ;
49+ tokio:: time:: sleep ( RPC_POLL_INTERVAL ) . await ;
5150 continue ;
5251 }
5352 }
@@ -369,7 +368,7 @@ impl Node for PluginNodeServer {
369368 req. request. signer_state. len( )
370369 ) ;
371370
372- eprintln ! ( "WIRE: plugin -> signer: {:?}" , req) ;
371+ eprintln ! ( "WIRE: plugin -> signer: {:?}" , req) ;
373372 if let Err ( e) = tx. send ( Ok ( req. request ) ) . await {
374373 warn ! ( "Error streaming request {:?} to hsm_id={}" , e, hsm_id) ;
375374 break ;
@@ -394,7 +393,7 @@ impl Node for PluginNodeServer {
394393 log:: warn!( "The above error was returned instead of a response." ) ;
395394 return Ok ( Response :: new ( pb:: Empty :: default ( ) ) ) ;
396395 }
397- eprintln ! ( "WIRE: signer -> plugin: {:?}" , req) ;
396+ eprintln ! ( "WIRE: signer -> plugin: {:?}" , req) ;
398397
399398 // Create a state from the key-value-version tuples. Need to
400399 // convert here, since `pb` is duplicated in the two different
0 commit comments