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

Function layer_set_node_bias

plugins/askrene/layer.c:946–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

944}
945
946const struct node_bias *layer_set_node_bias(struct layer *layer,
947 const struct node_id *node,
948 const char *description TAKES,
949 s8 bias_factor,
950 bool relative,
951 bool dir_out,
952 u64 timestamp)
953{
954 const struct node_bias *bias;
955
956 bias = set_node_bias(layer, node, description, bias_factor, relative,
957 dir_out, timestamp);
958 /* Save the resulting bias even if zero to override previously written
959 * values. */
960 save_node_bias(layer, bias);
961
962 /* Don't bother keeping around zero biases */
963 if (bias->in_bias == 0 && bias->out_bias == 0) {
964 node_bias_hash_del(layer->node_biases, bias);
965 bias = tal_free(bias);
966 }
967 return bias;
968}
969
970void layer_apply_biases(const struct layer *layer,
971 const struct gossmap *gossmap,

Callers 1

json_askrene_bias_nodeFunction · 0.85

Calls 3

set_node_biasFunction · 0.85
save_node_biasFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected