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() {
64
64
// Setup CLN
65
65
let sock = "/tmp/lightning-rpc" ;
66
66
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
+ } ;
68
78
let cln_node_id = PublicKey :: from_str ( & cln_info. id ) . unwrap ( ) ;
69
79
let cln_address: SocketAddress = match cln_info. binding . first ( ) . unwrap ( ) {
70
80
NetworkAddress :: Ipv4 { address, port } => {
You can’t perform that action at this time.
0 commit comments