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

Function commit_cmp

channeld/channeld.c:2476–2492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2474}
2475
2476static int commit_cmp(const void *a, const void *n, void *peer)
2477{
2478 int commit_index_a = commit_index_from_msg(*(u8**)a, peer);
2479 int commit_index_n = commit_index_from_msg(*(u8**)n, peer);
2480
2481 if (commit_index_a == commit_index_n)
2482 return 0;
2483 /* Unrecognized commits go on the end */
2484 if (commit_index_a == -1)
2485 return 1;
2486
2487 if (commit_index_n == -1)
2488 return -1;
2489
2490 /* Otherwise we sort by commit_index */
2491 return commit_index_a - commit_index_n;
2492}
2493
2494static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
2495 const u8 *msg,

Callers

nothing calls this directly

Calls 1

commit_index_from_msgFunction · 0.85

Tested by

no test coverage detected