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

Function peer_save_commitsig_received

lightningd/peer_htlcs.c:2217–2241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2215}
2216
2217static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
2218 struct bitcoin_tx *tx,
2219 const struct bitcoin_signature *commit_sig)
2220{
2221 if (commitnum != channel->next_index[LOCAL]) {
2222 channel_internal_error(channel,
2223 "channel_got_commitsig: expected commitnum %"PRIu64
2224 " got %"PRIu64,
2225 channel->next_index[LOCAL], commitnum);
2226 return false;
2227 }
2228
2229 /* Basic sanity check */
2230 if (!valid_commitment_tx(channel, tx))
2231 return false;
2232
2233 channel->next_index[LOCAL]++;
2234
2235 /* DTODO: Add inflight_commit_sigs to the DB */
2236
2237 /* Update channel->last_sig and channel->last_tx before saving to db */
2238 channel_set_last_tx(channel, tx, commit_sig);
2239
2240 return true;
2241}
2242
2243static bool peer_save_commitsig_sent(struct channel *channel, u64 commitnum)
2244{

Callers 1

peer_got_commitsigFunction · 0.85

Calls 3

valid_commitment_txFunction · 0.85
channel_internal_errorFunction · 0.70
channel_set_last_txFunction · 0.70

Tested by

no test coverage detected