| 320 | |
| 321 | |
| 322 | void validate_initial_commitment_signature(int hsm_fd, |
| 323 | struct bitcoin_tx *tx, |
| 324 | struct bitcoin_signature *sig) |
| 325 | { |
| 326 | u32 feerate; |
| 327 | u64 commit_num; |
| 328 | const u8 *msg; |
| 329 | struct secret *old_secret; |
| 330 | struct pubkey next_point; |
| 331 | |
| 332 | /* Validate the counterparty's signature. */ |
| 333 | feerate = 0; /* unused since there are no htlcs */ |
| 334 | commit_num = 0; |
| 335 | msg = towire_hsmd_validate_commitment_tx(NULL, |
| 336 | tx, |
| 337 | NULL, /* No htlcs */ |
| 338 | commit_num, |
| 339 | feerate, |
| 340 | sig, |
| 341 | NULL /* No htlc_sigs */); |
| 342 | wire_sync_write(hsm_fd, take(msg)); |
| 343 | msg = wire_sync_read(tmpctx, hsm_fd); |
| 344 | if (!fromwire_hsmd_validate_commitment_tx_reply(tmpctx, msg, &old_secret, &next_point)) |
| 345 | status_failed(STATUS_FAIL_HSM_IO, |
| 346 | "Reading validate_commitment_tx reply: %s", |
| 347 | tal_hex(tmpctx, msg)); |
| 348 | } |
| 349 |
no test coverage detected