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

Function peer_save_commitsig_received

lightningd/peer_htlcs.c:2147–2171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2145}
2146
2147static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
2148 struct bitcoin_tx *tx,
2149 const struct bitcoin_signature *commit_sig)
2150{
2151 if (commitnum != channel->next_index[LOCAL]) {
2152 channel_internal_error(channel,
2153 "channel_got_commitsig: expected commitnum %"PRIu64
2154 " got %"PRIu64,
2155 channel->next_index[LOCAL], commitnum);
2156 return false;
2157 }
2158
2159 /* Basic sanity check */
2160 if (!valid_commitment_tx(channel, tx))
2161 return false;
2162
2163 channel->next_index[LOCAL]++;
2164
2165 /* DTODO: Add inflight_commit_sigs to the DB */
2166
2167 /* Update channel->last_sig and channel->last_tx before saving to db */
2168 channel_set_last_tx(channel, tx, commit_sig);
2169
2170 return true;
2171}
2172
2173static bool peer_save_commitsig_sent(struct channel *channel, u64 commitnum)
2174{

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