| 260 | |
| 261 | |
| 262 | void validate_initial_commitment_signature(int hsm_fd, |
| 263 | struct bitcoin_tx *tx, |
| 264 | struct bitcoin_signature *sig) |
| 265 | { |
| 266 | u32 feerate; |
| 267 | u64 commit_num; |
| 268 | const u8 *msg; |
| 269 | struct secret *old_secret; |
| 270 | struct pubkey next_point; |
| 271 | |
| 272 | /* Validate the counterparty's signature. */ |
| 273 | feerate = 0; /* unused since there are no htlcs */ |
| 274 | commit_num = 0; |
| 275 | msg = towire_hsmd_validate_commitment_tx(NULL, |
| 276 | tx, |
| 277 | NULL, /* No htlcs */ |
| 278 | commit_num, |
| 279 | feerate, |
| 280 | sig, |
| 281 | NULL /* No htlc_sigs */); |
| 282 | wire_sync_write(hsm_fd, take(msg)); |
| 283 | msg = wire_sync_read(tmpctx, hsm_fd); |
| 284 | if (!fromwire_hsmd_validate_commitment_tx_reply(tmpctx, msg, &old_secret, &next_point)) |
| 285 | status_failed(STATUS_FAIL_HSM_IO, |
| 286 | "Reading validate_commitment_tx reply: %s", |
| 287 | tal_hex(tmpctx, msg)); |
| 288 | } |
| 289 |
no test coverage detected