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

Function peer_save_commitsig_received

lightningd/peer_htlcs.c:1902–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1900}
1901
1902static bool peer_save_commitsig_received(struct channel *channel, u64 commitnum,
1903 struct bitcoin_tx *tx,
1904 const struct bitcoin_signature *commit_sig)
1905{
1906 if (commitnum != channel->next_index[LOCAL]) {
1907 channel_internal_error(channel,
1908 "channel_got_commitsig: expected commitnum %"PRIu64
1909 " got %"PRIu64,
1910 channel->next_index[LOCAL], commitnum);
1911 return false;
1912 }
1913
1914 /* Basic sanity check */
1915 if (!valid_commitment_tx(channel, tx))
1916 return false;
1917
1918 channel->next_index[LOCAL]++;
1919
1920 /* Update channel->last_sig and channel->last_tx before saving to db */
1921 channel_set_last_tx(channel, tx, commit_sig, TX_CHANNEL_UNILATERAL);
1922
1923 return true;
1924}
1925
1926static bool peer_save_commitsig_sent(struct channel *channel, u64 commitnum)
1927{

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