| 299 | } |
| 300 | |
| 301 | static 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 | |
| 324 | static const struct bias *set_bias(struct layer *layer, |
| 325 | const struct short_channel_id_dir *scidd, |
no outgoing calls
no test coverage detected