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

Function exchange_commits

tests/fuzz/fuzz-full_channel.c:57–70  ·  view source on GitHub ↗

These helpers invoke the underlying full_channel API and then drive * the full commitment dance (the four steps of sending_commit -> * recv_revoke_and_ack -> recv_commit -> sending_revoke_and_ack) * in the correct opener vs. accepter order. */

Source from the content-addressed store, hash-verified

55 * in the correct opener vs. accepter order.
56 */
57static void exchange_commits(struct channel *channel, enum side side, const struct htlc ***changed_htlcs)
58{
59 if (side == LOCAL) {
60 channel_sending_commit(channel, changed_htlcs);
61 channel_rcvd_revoke_and_ack(channel, changed_htlcs);
62 channel_rcvd_commit(channel, changed_htlcs);
63 channel_sending_revoke_and_ack(channel);
64 } else {
65 channel_rcvd_commit(channel, changed_htlcs);
66 channel_sending_revoke_and_ack(channel);
67 channel_sending_commit(channel, changed_htlcs);
68 channel_rcvd_revoke_and_ack(channel, changed_htlcs);
69 }
70}
71
72/* Randomize the commitment dance order. */
73static void fuzz_exchange_commits(struct channel *channel, const struct htlc ***changed_htlcs,

Callers 1

runFunction · 0.85

Calls 4

channel_sending_commitFunction · 0.85
channel_rcvd_commitFunction · 0.85

Tested by

no test coverage detected