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

Function check_cannounce

common/test/run-gossmap_local.c:240–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238};
239
240static void check_cannounce(const u8 *cannounce,
241 const struct short_channel_id *scid,
242 const struct node_id *n1,
243 const struct node_id *n2)
244{
245 secp256k1_ecdsa_signature sig;
246 u8 *features;
247 struct bitcoin_blkid chain_hash;
248 struct short_channel_id actual_scid;
249 struct node_id actual_n1, actual_n2;
250 struct pubkey k;
251
252 assert(fromwire_channel_announcement(cannounce, cannounce,
253 &sig, &sig, &sig, &sig,
254 &features, &chain_hash,
255 &actual_scid,
256 &actual_n1,
257 &actual_n2,
258 &k, &k));
259 assert(short_channel_id_eq(&actual_scid, scid));
260 if (node_id_cmp(n1, n2) < 0) {
261 assert(node_id_eq(&actual_n1, n1));
262 assert(node_id_eq(&actual_n2, n2));
263 } else {
264 assert(node_id_eq(&actual_n1, n2));
265 assert(node_id_eq(&actual_n2, n1));
266 }
267}
268
269static void check_nannounce(const u8 *nannounce,
270 const struct node_id *n)

Callers 1

mainFunction · 0.70

Calls 2

node_id_eqFunction · 0.85
node_id_cmpFunction · 0.50

Tested by

no test coverage detected