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

Function layer_apply_constraints

plugins/askrene/layer.c:996–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994}
995
996void layer_apply_constraints(const struct layer *layer,
997 const struct short_channel_id_dir *scidd,
998 struct amount_msat *min,
999 struct amount_msat *max)
1000{
1001 struct constraint *c;
1002 struct constraint_hash_iter cit;
1003
1004 /* We can have more than one: apply them all! */
1005 for (c = constraint_hash_getfirst(layer->constraints, scidd, &cit);
1006 c;
1007 c = constraint_hash_getnext(layer->constraints, scidd, &cit)) {
1008 *min = amount_msat_max(*min, c->min);
1009 *max = amount_msat_min(*max, c->max);
1010 }
1011}
1012
1013const struct constraint *layer_add_constraint(struct layer *layer,
1014 const struct short_channel_id_dir *scidd,

Callers 2

why_max_constrainedFunction · 0.85
get_constraintsFunction · 0.85

Calls 2

amount_msat_maxFunction · 0.85
amount_msat_minFunction · 0.85

Tested by

no test coverage detected