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

Function handle_commit_signed

openingd/dualopend.c:1342–1370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1340}
1341
1342static void handle_commit_signed(struct state *state, const u8 *msg)
1343{
1344 struct bitcoin_tx *local_commit;
1345 struct bitcoin_signature remote_sig;
1346 struct tx_state *tx_state = state->tx_state;
1347 char *err;
1348
1349 if (!state->reconnected)
1350 open_err_fatal(state, "Sent commit signed out of turn (not reconnect)"
1351 ": %s", tal_hex(msg, msg));
1352
1353 report_channel_hsmd(state, tx_state);
1354 err = do_commit_signed_received(tmpctx, msg, state, tx_state,
1355 &local_commit, &remote_sig);
1356 if (err)
1357 open_err_fatal(state,
1358 "They sent invalid commitment sig: %s", err);
1359
1360 /* Send the commitment_signed to lightningd; will save to db */
1361 peer_billboard(false, "channel open: commitment received, "
1362 "sending to lightningd to save");
1363
1364 /* FIXME: add pbase for first time commits? */
1365 msg = towire_dualopend_commit_rcvd(state,
1366 local_commit,
1367 &remote_sig,
1368 NULL);
1369 wire_sync_write(REQ_FD, take(msg));
1370}
1371
1372static void handle_tx_sigs(struct state *state, const u8 *msg)
1373{

Callers 1

handle_peer_inFunction · 0.85

Calls 6

open_err_fatalFunction · 0.85
tal_hexFunction · 0.85
report_channel_hsmdFunction · 0.85
peer_billboardFunction · 0.50
wire_sync_writeFunction · 0.50

Tested by

no test coverage detected