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

Function main

onchaind/onchaind.c:3389–3566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3387}
3388
3389int main(int argc, char *argv[])
3390{
3391 setup_locale();
3392
3393 const tal_t *ctx = tal(NULL, char);
3394 u8 *msg;
3395 struct pubkey remote_per_commit_point, old_remote_per_commit_point;
3396 enum side opener;
3397 struct basepoints basepoints[NUM_SIDES];
3398 struct shachain shachain;
3399 struct tx_parts *tx;
3400 struct tracked_output **outs;
3401 struct bitcoin_outpoint funding;
3402 struct bitcoin_txid our_broadcast_txid;
3403 struct bitcoin_signature *remote_htlc_sigs;
3404 struct amount_sat funding_sats;
3405 u8 *scriptpubkey[NUM_SIDES];
3406 u32 locktime, tx_blockheight;
3407
3408 subdaemon_setup(argc, argv);
3409
3410 status_setup_sync(REQ_FD);
3411
3412 missing_htlc_msgs = tal_arr(ctx, u8 *, 0);
3413 queued_msgs = tal_arr(ctx, const u8 *, 0);
3414
3415 msg = wire_sync_read(tmpctx, REQ_FD);
3416 if (!fromwire_onchaind_init(tmpctx, msg,
3417 &shachain,
3418 &chainparams,
3419 &funding_sats,
3420 &our_msat,
3421 &old_remote_per_commit_point,
3422 &remote_per_commit_point,
3423 &to_self_delay[LOCAL],
3424 &to_self_delay[REMOTE],
3425 &dust_limit,
3426 &our_broadcast_txid,
3427 &scriptpubkey[LOCAL],
3428 &scriptpubkey[REMOTE],
3429 &opener,
3430 &basepoints[LOCAL],
3431 &basepoints[REMOTE],
3432 &tx,
3433 &locktime,
3434 &tx_blockheight,
3435 &reasonable_depth,
3436 &remote_htlc_sigs,
3437 &min_possible_feerate,
3438 &max_possible_feerate,
3439 &funding_pubkey[LOCAL],
3440 &funding_pubkey[REMOTE],
3441 &static_remotekey_start[LOCAL],
3442 &static_remotekey_start[REMOTE],
3443 &option_anchor_outputs,
3444 &option_anchors_zero_fee_htlc_tx,
3445 &min_relay_feerate)) {
3446 master_badmsg(WIRE_ONCHAIND_INIT, msg);

Callers

nothing calls this directly

Calls 15

setup_localeFunction · 0.85
fromwire_onchaind_initFunction · 0.85
wally_tx_input_get_txidFunction · 0.85
new_tracked_outputFunction · 0.85
send_coin_mvtFunction · 0.85
is_elementsFunction · 0.85
fmt_pubkeyFunction · 0.85
trim_maximum_feerateFunction · 0.85
is_mutual_closeFunction · 0.85
record_mutual_closeFunction · 0.85
handle_mutual_closeFunction · 0.85
unmask_commit_numberFunction · 0.85

Tested by

no test coverage detected