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

Function add_constraint

plugins/askrene/layer.c:301–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301static const struct constraint *add_constraint(struct layer *layer,
302 const struct short_channel_id_dir *scidd,
303 u64 timestamp,
304 const struct amount_msat *min,
305 const struct amount_msat *max)
306{
307 struct constraint *c = tal(layer, struct constraint);
308 c->scidd = *scidd;
309
310 if (min)
311 c->min = *min;
312 else
313 c->min = AMOUNT_MSAT(0);
314 if (max)
315 c->max = *max;
316 else
317 c->max = AMOUNT_MSAT(UINT64_MAX);
318 c->timestamp = timestamp;
319
320 constraint_hash_add(layer->constraints, c);
321 return c;
322}
323
324static const struct bias *set_bias(struct layer *layer,
325 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