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

Function json_to_number

common/json_parse.c:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool json_to_number(const char *buffer, const jsmntok_t *tok,
59 unsigned int *num)
60{
61 uint64_t u64;
62
63 if (!json_to_u64(buffer, tok, &u64))
64 return false;
65 *num = u64;
66
67 /* Just in case it doesn't fit. */
68 if (*num != u64)
69 return false;
70 return true;
71}
72
73bool json_to_u16(const char *buffer, const jsmntok_t *tok,
74 short unsigned int *num)

Callers 13

param_numberFunction · 0.70
test_query_channel_rangeFunction · 0.50
test_reply_channel_rangeFunction · 0.50
param_txoutFunction · 0.50
param_route_hopFunction · 0.50
param_feerate_uncheckedFunction · 0.50
param_feerate_valFunction · 0.50
unpack_routeFunction · 0.50
psbt_createdFunction · 0.50
openchannel_update_okFunction · 0.50

Calls 1

json_to_u64Function · 0.50

Tested by 2

test_query_channel_rangeFunction · 0.40
test_reply_channel_rangeFunction · 0.40