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

Function check_result

plugins/offers_offer.c:260–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258};
259
260static struct command_result *check_result(struct command *cmd,
261 const char *buf,
262 const jsmntok_t *result,
263 void *arg UNNEEDED)
264{
265 bool active;
266
267 /* If it's inactive, we can't return it, */
268 if (!json_to_bool(buf, json_get_member(buf, result, "active"),
269 &active)) {
270 return command_fail(cmd,
271 LIGHTNINGD,
272 "Bad creaoffer status reply %.*s",
273 json_tok_full_len(result),
274 json_tok_full(buf, result));
275 }
276 if (!active)
277 return command_fail(cmd,
278 OFFER_ALREADY_EXISTS,
279 "Offer already exists, but isn't active");
280
281 /* Otherwise, push through the result. */
282 return forward_result(cmd, buf, result, arg);
283}
284
285static struct command_result *create_offer(struct command *cmd,
286 struct offer_info *offinfo)

Callers

nothing calls this directly

Calls 6

forward_resultFunction · 0.85
command_failFunction · 0.70
json_to_boolFunction · 0.50
json_get_memberFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected