lightingd: do a local short_channel_id lookup for forwarding.

Even without optimization, it's faster to walk all the channels than
ping another daemon and wait for the response.

Changelog-Changed: Forwarding messages is now much faster (less inter-daemon traffic)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-02-27 14:56:36 +10:30
parent 40e3566e9a
commit f8a21f16c9
8 changed files with 30 additions and 132 deletions

View File

@@ -214,6 +214,9 @@ struct channel *active_channel_by_id(struct lightningd *ld,
struct channel *channel_by_dbid(struct lightningd *ld, const u64 dbid);
struct channel *active_channel_by_scid(struct lightningd *ld,
const struct short_channel_id *scid);
void channel_set_last_tx(struct channel *channel,
struct bitcoin_tx *tx,
const struct bitcoin_signature *sig,