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

Function json_renepay

plugins/renepay/main.c:157–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157static struct command_result *json_renepay(struct command *cmd, const char *buf,
158 const jsmntok_t *params)
159{
160 /* === Parse command line arguments === */
161 // TODO check if we leak some of these temporary variables
162
163 const char *invstr;
164 struct amount_msat *msat;
165 struct amount_msat *maxfee;
166 struct amount_msat *inv_msat = NULL;
167 u32 *maxdelay;
168 u32 *retryfor;
169 const char *description;
170 const char *label;
171 struct route_exclusion **exclusions;
172
173 // dev options
174 bool *use_shadow;
175
176 // MCF options
177 u64 *base_fee_penalty_millionths; // base fee to proportional fee
178 u64 *prob_cost_factor_millionths; // prob. cost to proportional fee
179 u64 *riskfactor_millionths; // delay to proportional proportional fee
180 u64 *min_prob_success_millionths; // target probability
181
182 /* base probability of success, probability for a randomly picked
183 * channel to be able to forward a payment request of amount greater
184 * than zero. */
185 u64 *base_prob_success_millionths;
186
187 u64 invexpiry;
188 struct sha256 *payment_hash = NULL;
189
190 if (!param(cmd, buf, params,
191 p_req("invstring", param_invstring, &invstr),
192 p_opt("amount_msat", param_msat, &msat),
193 p_opt("maxfee", param_msat, &maxfee),
194
195 p_opt_def("maxdelay", param_number, &maxdelay,
196 /* maxdelay has a configuration default value named
197 * "max-locktime-blocks", this is retrieved at
198 * init. */
199 pay_plugin->maxdelay_default),
200
201 p_opt_def("retry_for", param_number, &retryfor,
202 60), // 60 seconds
203 p_opt("description", param_string, &description),
204 p_opt("label", param_string, &label),
205 p_opt("exclude", param_route_exclusion_array, &exclusions),
206
207 p_opt_dev("dev_use_shadow", param_bool, &use_shadow, true),
208
209 // MCF options
210 p_opt_dev("dev_base_fee_penalty", param_millionths,
211 &base_fee_penalty_millionths,
212 10000000), // default is 10.0
213 p_opt_dev("dev_prob_cost_factor", param_millionths,
214 &prob_cost_factor_millionths,

Callers

nothing calls this directly

Calls 15

bolt12_has_prefixFunction · 0.85
invoice_decodeFunction · 0.85
invoice_expiryFunction · 0.85
bolt11_decodeFunction · 0.85
feature_offeredFunction · 0.85
amount_msat_divFunction · 0.85
clock_timeFunction · 0.85
tal_strdup_or_nullFunction · 0.85
node_id_from_pubkeyFunction · 0.85
abortFunction · 0.85
payment_set_constraintsFunction · 0.85
payment_refreshFunction · 0.85

Tested by

no test coverage detected