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

Function find_commando

plugins/commando.c:69–81  ·  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

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

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