gossipd: keep a flag to indicate that we have features in channel_announcement.

This saves us keeping it in memory (so far, no channels have features), but
lets us optimize that case so we don't need to hit the disk for most of the
channels in listchannels.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-05-04 09:48:34 +09:30
parent 855debcfe1
commit 7cac5be5cb
6 changed files with 21 additions and 9 deletions

View File

@@ -41,6 +41,10 @@ struct half_chan {
/* Token bucket */
u8 tokens;
/* Feature cache for parent chan: squeezed in here where it would
* otherwise simply be padding. */
u8 any_features;
/* Minimum and maximum number of msatoshi in an HTLC */
struct amount_msat htlc_minimum, htlc_maximum;
};
@@ -361,7 +365,8 @@ struct chan *new_chan(struct routing_state *rstate,
const struct short_channel_id *scid,
const struct node_id *id1,
const struct node_id *id2,
struct amount_sat sat);
struct amount_sat sat,
const u8 *features);
/* Handlers for incoming messages */