MCPcopy Create free account
hub / github.com/ElementsProject/lightning / enqueue_cupdate

Function enqueue_cupdate

gossipd/gossmap_manage.c:125–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123static void start_prune_timer(struct gossmap_manage *gm);
124
125static void enqueue_cupdate(struct pending_cupdate ***queue,
126 struct short_channel_id scid,
127 const secp256k1_ecdsa_signature *signature,
128 u8 message_flags,
129 u8 channel_flags,
130 u16 cltv_expiry_delta,
131 struct amount_msat htlc_minimum_msat,
132 struct amount_msat htlc_maximum_msat,
133 u32 fee_base_msat,
134 u32 fee_proportional_millionths,
135 u32 timestamp,
136 const u8 *update TAKES,
137 const struct node_id *source_peer)
138{
139 struct pending_cupdate *pcu;
140
141 if (tal_count(*queue) > PENDING_LIMIT) {
142 static bool warned = false;
143 status_unusual_once(&warned,
144 CI_UNEXPECTED
145 "channel_updates being flooded by %s: dropping some",
146 source_peer
147 ? fmt_node_id(tmpctx, source_peer)
148 : "unknown");
149 tal_free_if_taken(update);
150 tal_free_if_taken(source_peer);
151 return;
152 }
153
154 pcu = tal(*queue, struct pending_cupdate);
155
156 pcu->scid = scid;
157 pcu->signature = *signature;
158 pcu->message_flags = message_flags;
159 pcu->channel_flags = channel_flags;
160 pcu->cltv_expiry_delta = cltv_expiry_delta;
161 pcu->htlc_minimum_msat = htlc_minimum_msat;
162 pcu->htlc_maximum_msat = htlc_maximum_msat;
163 pcu->fee_base_msat = fee_base_msat;
164 pcu->fee_proportional_millionths = fee_proportional_millionths;
165 pcu->timestamp = timestamp;
166 pcu->update = tal_dup_talarr(pcu, u8, update);
167 pcu->source_peer = tal_dup_or_null(pcu, struct node_id, source_peer);
168
169 tal_arr_expand(queue, pcu);
170}
171
172static void enqueue_nannounce(struct pending_nannounce ***queue,
173 const struct node_id *node_id,

Callers 1

Calls 2

fmt_node_idFunction · 0.85
tal_free_if_takenFunction · 0.85

Tested by

no test coverage detected