Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct inject update #4361

Merged

Conversation

rustyrussell
Copy link
Contributor

This makes "pay" inject the update directly, and ensures gossipd doesn't suppress it. This removes some uncleanliness from inside lightningd, too.

@rustyrussell rustyrussell added this to the v0.9.4 milestone Jan 28, 2021
This overcomes the internal spam filter on updates, which can be useful
if we're actually trying to send through such a node.

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Fixed: Protocol: always accept channel_updates from errors, even they'd otherwise be rejected as spam.
Fixes: ElementsProject#4300
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup 👍

ACK c4b8e8e

@@ -1706,6 +1707,7 @@ static struct io_plan *handle_txout_reply(struct io_conn *conn,
struct amount_sat sat;
bool good;

status_debug("handle_txout_reply!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used somewhere? Otherwise it's likely to confuse users.


switch (fromwire_peektype(goss)) {
case WIRE_CHANNEL_ANNOUNCEMENT:
errmsg = handle_channel_announcement_msg(daemon, NULL, goss);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to verify that this still performs the chain_hash check, which is good, otherwise we could end up with some botched experiments :-)

Importantly, this is synchronous, so pay will be able to use it
reliably.

Signed-off-by: Rusty Russell <[email protected]>
Cut & paste from gossipd.

Signed-off-by: Rusty Russell <[email protected]>
We fix up the test by using pay, instead of sendpay (and making pay log
the expected message).

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Changed: sendpay no longer extracts updates from errors, the caller should do it from the `raw_message`.
Signed-off-by: Rusty Russell <[email protected]>
Changelog-Added: JSON-RPC: `addgossip` allows direct injection of network gossip messages.
@cdecker
Copy link
Member

cdecker commented Feb 2, 2021

ACK 9399fec

@cdecker cdecker merged commit 9da191e into ElementsProject:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants