File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,17 @@ fn test_cln() {
6464 // Setup CLN
6565 let sock = "/tmp/lightning-rpc" ;
6666 let cln_client = LightningRPC :: new ( & sock) ;
67- let cln_info = cln_client. getinfo ( ) . unwrap ( ) ;
67+ let cln_info = {
68+ loop {
69+ let info = cln_client. getinfo ( ) . unwrap ( ) ;
70+ // Wait for CLN to sync block height before channel open.
71+ // Prevents crash due to unset blockheight (see LDK Node issue #527).
72+ if info. blockheight > 0 {
73+ break info;
74+ }
75+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 250 ) ) ;
76+ }
77+ } ;
6878 let cln_node_id = PublicKey :: from_str ( & cln_info. id ) . unwrap ( ) ;
6979 let cln_address: SocketAddress = match cln_info. binding . first ( ) . unwrap ( ) {
7080 NetworkAddress :: Ipv4 { address, port } => {
You can’t perform that action at this time.
0 commit comments