| 237 | |
| 238 | |
| 239 | void validate_initial_commitment_signature(int hsm_fd, |
| 240 | struct bitcoin_tx *tx, |
| 241 | struct bitcoin_signature *sig) |
| 242 | { |
| 243 | u32 feerate; |
| 244 | u64 commit_num; |
| 245 | const u8 *msg; |
| 246 | struct secret *old_secret; |
| 247 | struct pubkey next_point; |
| 248 | |
| 249 | /* Validate the counterparty's signature. */ |
| 250 | feerate = 0; /* unused since there are no htlcs */ |
| 251 | commit_num = 0; |
| 252 | msg = towire_hsmd_validate_commitment_tx(NULL, |
| 253 | tx, |
| 254 | NULL, /* No htlcs */ |
| 255 | commit_num, |
| 256 | feerate, |
| 257 | sig, |
| 258 | NULL /* No htlc_sigs */); |
| 259 | wire_sync_write(hsm_fd, take(msg)); |
| 260 | msg = wire_sync_read(tmpctx, hsm_fd); |
| 261 | if (!fromwire_hsmd_validate_commitment_tx_reply(tmpctx, msg, &old_secret, &next_point)) |
| 262 | status_failed(STATUS_FAIL_HSM_IO, |
| 263 | "Reading validate_commitment_tx reply: %s", |
| 264 | tal_hex(tmpctx, msg)); |
| 265 | } |
| 266 |
no test coverage detected