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

Function validate_initial_commitment_signature

openingd/common.c:239–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239void 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

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