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

Function opening_got_offer

lightningd/opening_control.c:866–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864 struct openchannel_hook_payload *);
865
866static void opening_got_offer(struct subd *openingd,
867 const u8 *msg,
868 struct uncommitted_channel *uc)
869{
870 struct openchannel_hook_payload *payload;
871
872 payload = tal(openingd, struct openchannel_hook_payload);
873 payload->openingd = openingd;
874 payload->uc = uc;
875 payload->our_upfront_shutdown_script = NULL;
876 payload->errmsg = NULL;
877 if (!fromwire_openingd_got_offer(payload, msg,
878 &payload->funding_satoshis,
879 &payload->push_msat,
880 &payload->dust_limit_satoshis,
881 &payload->max_htlc_value_in_flight_msat,
882 &payload->channel_reserve_satoshis,
883 &payload->htlc_minimum_msat,
884 &payload->feerate_per_kw,
885 &payload->to_self_delay,
886 &payload->max_accepted_htlcs,
887 &payload->channel_flags,
888 &payload->shutdown_scriptpubkey,
889 &payload->channel_type)) {
890 log_broken(openingd->log, "Malformed opening_got_offer %s",
891 tal_hex(tmpctx, msg));
892 tal_free(openingd);
893 return;
894 }
895
896 /* Don't allow opening if we don't know any fees; even if
897 * ignore-feerates is set. */
898 if (unknown_feerates(openingd->ld->topology)) {
899 subd_send_msg(openingd,
900 take(towire_openingd_got_offer_reply(NULL, "Cannot accept channel: feerates unknown",
901 NULL, NULL, NULL, 0)));
902 tal_free(payload);
903 return;
904 }
905
906 tal_add_destructor2(openingd, openchannel_payload_remove_openingd, payload);
907 plugin_hook_call_openchannel(openingd->ld, NULL, payload);
908}
909
910static unsigned int openingd_msg(struct subd *openingd,
911 const u8 *msg, const int *fds)

Callers 1

openingd_msgFunction · 0.85

Calls 4

tal_hexFunction · 0.85
tal_freeFunction · 0.85
unknown_feeratesFunction · 0.85
subd_send_msgFunction · 0.70

Tested by

no test coverage detected