| 1900 | } |
| 1901 | |
| 1902 | static 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 | |
| 1926 | static bool peer_save_commitsig_sent(struct channel *channel, u64 commitnum) |
| 1927 | { |
no test coverage detected