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

Function penalty_base_by_commitnum

channeld/channeld.c:2512–2524  ·  view source on GitHub ↗

Pops the penalty base for the given commitnum from our internal list. There * may not be one, in which case we return NULL and leave the list * unmodified. */

Source from the content-addressed store, hash-verified

2510 * may not be one, in which case we return NULL and leave the list
2511 * unmodified. */
2512static struct penalty_base *
2513penalty_base_by_commitnum(const tal_t *ctx, struct peer *peer, u64 commitnum)
2514{
2515 struct penalty_base *res = NULL;
2516 for (size_t i = 0; i < tal_count(peer->pbases); i++) {
2517 if (peer->pbases[i]->commitment_num == commitnum) {
2518 res = tal_steal(ctx, peer->pbases[i]);
2519 tal_arr_remove(&peer->pbases, i);
2520 break;
2521 }
2522 }
2523 return res;
2524}
2525
2526static u8 *got_revoke_msg(struct peer *peer, u64 revoke_num,
2527 const struct secret *per_commitment_secret,

Callers 1

got_revoke_msgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected