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

Function main

onchaind/onchaind.c:3871–4060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3869}
3870
3871int main(int argc, char *argv[])
3872{
3873 setup_locale();
3874
3875 const tal_t *ctx = tal(NULL, char);
3876 u8 *msg;
3877 struct pubkey remote_per_commit_point, old_remote_per_commit_point;
3878 enum side opener;
3879 struct basepoints basepoints[NUM_SIDES];
3880 struct shachain shachain;
3881 struct tx_parts *tx;
3882 struct tracked_output **outs;
3883 struct bitcoin_outpoint funding;
3884 struct bitcoin_txid our_broadcast_txid;
3885 struct bitcoin_signature *remote_htlc_sigs;
3886 struct amount_sat funding_sats;
3887 u8 *scriptpubkey[NUM_SIDES];
3888 u32 locktime, tx_blockheight;
3889 struct pubkey *possible_remote_per_commitment_point;
3890
3891 subdaemon_setup(argc, argv);
3892
3893 status_setup_sync(REQ_FD);
3894
3895 missing_htlc_msgs = tal_arr(ctx, u8 *, 0);
3896 queued_msgs = tal_arr(ctx, u8 *, 0);
3897
3898 msg = wire_sync_read(tmpctx, REQ_FD);
3899 if (!fromwire_onchaind_init(tmpctx, msg,
3900 &shachain,
3901 &chainparams,
3902 &funding_sats,
3903 &our_msat,
3904 &old_remote_per_commit_point,
3905 &remote_per_commit_point,
3906 &to_self_delay[LOCAL],
3907 &to_self_delay[REMOTE],
3908 &delayed_to_us_feerate,
3909 &htlc_feerate,
3910 &penalty_feerate,
3911 &dust_limit,
3912 &our_broadcast_txid,
3913 &scriptpubkey[LOCAL],
3914 &scriptpubkey[REMOTE],
3915 &our_wallet_index,
3916 &our_wallet_ext_key,
3917 &our_wallet_pubkey,
3918 &opener,
3919 &basepoints[LOCAL],
3920 &basepoints[REMOTE],
3921 &tx,
3922 &locktime,
3923 &tx_blockheight,
3924 &reasonable_depth,
3925 &remote_htlc_sigs,
3926 &min_possible_feerate,
3927 &max_possible_feerate,
3928 &possible_remote_per_commitment_point,

Callers

nothing calls this directly

Calls 15

setup_localeFunction · 0.85
wally_tx_input_get_txidFunction · 0.85
new_tracked_outputFunction · 0.85
send_coin_mvtFunction · 0.85
is_elementsFunction · 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
revocations_receivedFunction · 0.85
is_local_commitmentFunction · 0.85

Tested by

no test coverage detected