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

Function penalty_base_by_commitnum

channeld/channeld.c:1754–1766  ·  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

1752 * may not be one, in which case we return NULL and leave the list
1753 * unmodified. */
1754static struct penalty_base *
1755penalty_base_by_commitnum(const tal_t *ctx, struct peer *peer, u64 commitnum)
1756{
1757 struct penalty_base *res = NULL;
1758 for (size_t i = 0; i < tal_count(peer->pbases); i++) {
1759 if (peer->pbases[i]->commitment_num == commitnum) {
1760 res = tal_steal(ctx, peer->pbases[i]);
1761 tal_arr_remove(&peer->pbases, i);
1762 break;
1763 }
1764 }
1765 return res;
1766}
1767
1768static u8 *got_revoke_msg(struct peer *peer, u64 revoke_num,
1769 const struct secret *per_commitment_secret,

Callers 1

got_revoke_msgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected