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

Function validate_initial_commitment_signature

openingd/common.c:322–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321
322void 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

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