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

Function rate_limit_check

lightningd/runes.c:145–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145static const char *rate_limit_check(const tal_t *ctx,
146 const struct runes *runes,
147 const struct rune *rune,
148 const struct rune_altern *alt,
149 struct cond_info *cinfo)
150{
151 unsigned long r;
152 char *endp;
153 if (alt->condition != '=')
154 return "rate operator must be =";
155
156 r = strtoul(alt->value, &endp, 10);
157 if (endp == alt->value || *endp || r == 0 || r >= UINT32_MAX)
158 return "malformed rate";
159
160 return last_time_check(rune, cinfo, 60 * sec_per_nsec / r);
161}
162
163/* We need to initialize master runes secret early, so db can use rune_is_ours */
164struct runes *runes_early_init(struct lightningd *ld)

Callers 1

check_conditionFunction · 0.85

Calls 1

last_time_checkFunction · 0.85

Tested by

no test coverage detected