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

Function main

devtools/mkcommit.c:243–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243int main(int argc, char *argv[])
244{
245 struct secrets local, remote;
246 struct sha256 localseed, remoteseed;
247 struct basepoints localbase, remotebase;
248 struct pubkey funding_localkey, funding_remotekey;
249 u64 commitnum;
250 struct amount_sat funding_amount;
251 struct channel_id cid;
252 struct bitcoin_outpoint funding;
253 u32 feerate_per_kw;
254 struct pubkey local_per_commit_point, remote_per_commit_point;
255 struct bitcoin_signature local_sig, remote_sig;
256 struct channel_config localconfig, remoteconfig;
257 struct amount_msat local_msat, remote_msat;
258 int argnum;
259 struct bitcoin_tx **local_txs, **remote_txs;
260 enum side fee_payer;
261 u8 **witness;
262 const u8 *funding_wscript;
263 struct channel *channel;
264 struct existing_htlc **htlcs = tal_arr(NULL, struct existing_htlc *, 0);
265 const struct htlc **htlcmap;
266 struct privkey local_htlc_privkey, remote_htlc_privkey;
267 struct pubkey local_htlc_pubkey, remote_htlc_pubkey;
268 bool option_static_remotekey = false, option_anchor_outputs = false;
269 const struct channel_type *channel_type;
270 struct sha256_double hash;
271 u32 blockheight = 0;
272 int local_anchor_outnum;
273
274 setup_locale();
275 chainparams = chainparams_for_network("bitcoin");
276
277 secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY |
278 SECP256K1_CONTEXT_SIGN);
279
280 opt_register_noarg("--help|-h", opt_usage_and_exit,
281 "<commitnum> <funding-txid> <funding-txout> <funding-amount> <feerate-per-kw> <local-msat> <fee-payer> <localconfig> <remoteconfig> <localsecrets> <remotesecrets> [<htlc>...]\n"
282 "Where <config> are:\n"
283 " <to-self-delay>\n"
284 " <dustlimit>\n"
285 " <reserve-sat>\n"
286 "Where <secrets> are:\n"
287 " <funding-privkey>\n"
288 " <shachain-seed>\n"
289 " <revocation-base-secret>\n"
290 " <payment-base-secret>\n"
291 " <delayed-payment-base-secret>\n"
292 " <htlc-base-secret>\n"
293 "Where <htlc>s are:\n"
294 " <offer-side>\n"
295 " <payment-preimage>\n"
296 " <amount-msat>\n"
297 " <cltv-expiry>\n",
298 "Show this message");
299 opt_register_noarg("-v|--verbose", opt_set_bool, &verbose,
300 "Increase verbosity");

Callers

nothing calls this directly

Calls 15

setup_localeFunction · 0.85
chainparams_for_networkFunction · 0.85
opt_register_versionFunction · 0.85
opt_parseFunction · 0.85
opt_usage_exit_failFunction · 0.85
bitcoin_txid_from_hexFunction · 0.85
errxFunction · 0.85
parse_configFunction · 0.85
parse_secretsFunction · 0.85
amount_sat_sub_msatFunction · 0.85
parse_htlcFunction · 0.85
pubkey_from_privkeyFunction · 0.85

Tested by

no test coverage detected