| 2215 | } |
| 2216 | |
| 2217 | static 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 | |
| 2243 | static bool peer_save_commitsig_sent(struct channel *channel, u64 commitnum) |
| 2244 | { |
no test coverage detected