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

Function add_constraint

plugins/askrene/layer.c:296–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static const struct constraint *add_constraint(struct layer *layer,
297 const struct short_channel_id_dir *scidd,
298 u64 timestamp,
299 const struct amount_msat *min,
300 const struct amount_msat *max)
301{
302 struct constraint *c = tal(layer, struct constraint);
303 c->scidd = *scidd;
304
305 if (min)
306 c->min = *min;
307 else
308 c->min = AMOUNT_MSAT(0);
309 if (max)
310 c->max = *max;
311 else
312 c->max = AMOUNT_MSAT(UINT64_MAX);
313 c->timestamp = timestamp;
314
315 constraint_hash_add(layer->constraints, c);
316 return c;
317}
318
319static const struct bias *set_bias(struct layer *layer,
320 const struct short_channel_id_dir *scidd,

Callers 2

load_channel_constraintFunction · 0.85
layer_add_constraintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected