Skip to content

Commit 98f64fb

Browse files
committed
lightningd: don't crash listpeers if we're opening DF channel.
We call out to connectd to activate the peer, and while we do that, channel->owner is NULL. A better pattern would be to set up the unsaved channel once connectd has given us the peer, but this works for now. Fixes: #5204 Signed-off-by: Rusty Russell <[email protected]>
1 parent f6e7d0c commit 98f64fb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lightningd/dual_open_control.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ void json_add_unsaved_channel(struct json_stream *response,
120120
if (!channel->open_attempt)
121121
return;
122122

123+
/* If we're calling out to connectd to activate peer to start the
124+
* process, this will be NULL */
125+
if (!channel->owner)
126+
return;
127+
123128
oa = channel->open_attempt;
124129

125130
json_object_start(response, NULL);

tests/test_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ def test_multifunding_simple(node_factory, bitcoind):
17981798
l1.rpc.pay(inv)
17991799

18001800

1801-
@pytest.mark.xfail(strict=True)
1801+
@pytest.mark.openchannel('v1')
18021802
@pytest.mark.openchannel('v2')
18031803
def test_listpeers_crash(node_factory, bitcoind, executor):
18041804
'''

0 commit comments

Comments
 (0)