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

Function handle_commit_signed

openingd/dualopend.c:1270–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1268}
1269
1270static void handle_commit_signed(struct state *state, const u8 *msg)
1271{
1272 struct bitcoin_tx *local_commit;
1273 struct bitcoin_signature remote_sig;
1274 struct tx_state *tx_state = state->tx_state;
1275 char *err;
1276
1277 if (!state->reconnected)
1278 open_err_fatal(state, "Sent commit signed out of turn (not reconnect)"
1279 ": %s", tal_hex(msg, msg));
1280
1281 report_channel_hsmd(state, tx_state);
1282 err = do_commit_signed_received(tmpctx, msg, state, tx_state,
1283 &local_commit, &remote_sig);
1284 if (err)
1285 open_err_fatal(state,
1286 "They sent invalid commitment sig: %s", err);
1287
1288 /* Send the commitment_signed to lightningd; will save to db */
1289 peer_billboard(false, "channel open: commitment received, "
1290 "sending to lightningd to save");
1291
1292 /* FIXME: add pbase for first time commits? */
1293 msg = towire_dualopend_commit_rcvd(state,
1294 local_commit,
1295 &remote_sig,
1296 NULL);
1297 wire_sync_write(REQ_FD, take(msg));
1298}
1299
1300static void handle_tx_sigs(struct state *state, const u8 *msg)
1301{

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