Skip to content

Commit

Permalink
gossipd: don't send updates in error messages for unannounced channels.
Browse files Browse the repository at this point in the history
This restores the behaviour prior to `lightningd: use our cached
channel_update for errors instead of asking gossipd.`, where gossipd
would refuse to give us channel_updates for unannounced channels.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Feb 23, 2022
1 parent d56904d commit 1da9b30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 7 additions & 3 deletions gossipd/gossip_generation.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,13 @@ static u8 *sign_and_timestamp_update(const tal_t *ctx,
tal_free(unsigned_update);

/* Tell lightningd about this immediately (even if we're not actually
* applying it now) */
msg = towire_gossipd_got_local_channel_update(NULL, &chan->scid, update);
daemon_conn_send(daemon->master, take(msg));
* applying it now). We choose not to send info about private
* channels, even in errors. */
if (is_chan_public(chan)) {
msg = towire_gossipd_got_local_channel_update(NULL, &chan->scid,
update);
daemon_conn_send(daemon->master, take(msg));
}

return update;
}
Expand Down
4 changes: 1 addition & 3 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -1746,9 +1746,7 @@ def listpays_nofail(b11):
def test_pay_routeboost(node_factory, bitcoind, compat):
"""Make sure we can use routeboost information. """
# l1->l2->l3--private-->l4
# Note: l1 gets upset because it extracts update for private channel.
l1, l2 = node_factory.line_graph(2, announce_channels=True, wait_for_announce=True,
opts=[{'allow_bad_gossip': True}, {}])
l1, l2 = node_factory.line_graph(2, announce_channels=True, wait_for_announce=True)
l3, l4, l5 = node_factory.line_graph(3, announce_channels=False, wait_for_announce=False)

# This should a "could not find a route" because that's true.
Expand Down

0 comments on commit 1da9b30

Please sign in to comment.