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

Function find_commando

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

85
86/* NULL peer: don't care about peer. NULL id: don't care about id */
87static struct commando *find_commando(struct commando **arr,
88 const struct node_id *peer,
89 const u64 *id)
90{
91 for (size_t i = 0; i < tal_count(arr); i++) {
92 if (id && arr[i]->id != *id)
93 continue;
94 if (peer && !node_id_eq(&arr[i]->peer, peer))
95 continue;
96 return arr[i];
97 }
98 return NULL;
99}
100
101static void destroy_commando(struct commando *commando, struct commando ***arr)
102{

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