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

Function find_commando

plugins/commando.c:66–78  ·  view source on GitHub ↗

NULL peer: don't care about peer. NULL id: don't care about id */

Source from the content-addressed store, hash-verified

64
65/* NULL peer: don't care about peer. NULL id: don't care about id */
66static struct commando *find_commando(struct commando **arr,
67 const struct node_id *peer,
68 const u64 *id)
69{
70 for (size_t i = 0; i < tal_count(arr); i++) {
71 if (id && arr[i]->id != *id)
72 continue;
73 if (peer && !node_id_eq(&arr[i]->peer, peer))
74 continue;
75 return arr[i];
76 }
77 return NULL;
78}
79
80static void destroy_commando(struct commando *commando, struct commando ***arr)
81{

Callers 3

handle_incmdFunction · 0.85
handle_replyFunction · 0.85
json_commandoFunction · 0.85

Calls 1

node_id_eqFunction · 0.85

Tested by

no test coverage detected