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

Function hook_callable

lightningd/plugin_hook.c:313–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313static bool hook_callable(const struct hook_instance *hook,
314 const char *strfilterfield,
315 u64 intfilterfield)
316{
317 /* NULL? Skip */
318 if (!hook)
319 return false;
320
321 /* String filters? If there are some we must match one. */
322 if (hook->strfilters) {
323 for (size_t i = 0; i < tal_count(hook->strfilters); i++) {
324 if (streq(strfilterfield, hook->strfilters[i]))
325 return true;
326 }
327 return false;
328 }
329
330 /* Integer filters? */
331 if (hook->intfilters) {
332 for (size_t i = 0; i < tal_count(hook->intfilters); i++) {
333 if (intfilterfield == hook->intfilters[i])
334 return true;
335 }
336 return false;
337 }
338
339 /* No filters: always call. */
340 return true;
341}
342
343/* Returns true if it finished all the hooks (and thus didn't call anything) */
344static bool plugin_hook_call_next(struct plugin_hook_request *ph_req)

Callers 1

plugin_hook_call_nextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected