MCPcopy Create free account
hub / github.com/ElementsProject/lightning / validate_initial_commitment_signature

Function validate_initial_commitment_signature

openingd/common.c:262–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261
262void 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

Callers 3

fundee_channelFunction · 0.85

Calls 4

tal_hexFunction · 0.85
wire_sync_writeFunction · 0.50
wire_sync_readFunction · 0.50
status_failedFunction · 0.50

Tested by

no test coverage detected