| 2474 | } |
| 2475 | |
| 2476 | static 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 | |
| 2494 | static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer, |
| 2495 | const u8 *msg, |
nothing calls this directly
no test coverage detected