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

Function msat_or_any

plugins/offers_offer.c:12–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <plugins/offers_offer.h>
11
12static bool msat_or_any(const char *buffer,
13 const jsmntok_t *tok,
14 struct tlv_offer *offer)
15{
16 struct amount_msat msat;
17 if (json_tok_streq(buffer, tok, "any"))
18 return true;
19
20 if (!parse_amount_msat(&msat,
21 buffer + tok->start, tok->end - tok->start))
22 return false;
23
24 offer->amount = tal_dup(offer, u64,
25 &msat.millisatoshis); /* Raw: other currencies */
26 return true;
27}
28
29static struct command_result *param_msat_or_any(struct command *cmd,
30 const char *name,

Callers 2

param_msat_or_anyFunction · 0.85
param_amountFunction · 0.85

Calls 2

json_tok_streqFunction · 0.50
parse_amount_msatFunction · 0.50

Tested by

no test coverage detected