Skip to content

Commit a7ad891

Browse files
authored
Merge pull request #115 from TheBlueMatt/main
Fix race in peer connection in C++ demo app
2 parents fd396ce + 89def17 commit a7ad891

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
clang -target x86_64-pc-windows-gnu -L/usr/lib/gcc/x86_64-w64-mingw32/12-win32/ "$@"

lightning-c-bindings/demo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ class PeersConnection {
242242

243243
// Then disconnect the "main" connection, while another connection is being made.
244244
PeerManager_disconnect_by_node_id(&net1, ChannelManager_get_our_node_id(&cm2));
245+
PeerManager_disconnect_by_node_id(&net2, ChannelManager_get_our_node_id(&cm1));
245246
assert(!socket_connect(node1_handler, ChannelManager_get_our_node_id(&cm2), (sockaddr*)&listen_addr, sizeof(listen_addr)));
246247

247248
std::cout << __FILE__ << ":" << __LINE__ << " - " << "Awaiting new connection handshake..." << std::endl;

0 commit comments

Comments
 (0)