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

Function opening_got_offer

lightningd/opening_control.c:853–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851 struct openchannel_hook_payload *);
852
853static void opening_got_offer(struct subd *openingd,
854 const u8 *msg,
855 struct uncommitted_channel *uc)
856{
857 struct openchannel_hook_payload *payload;
858
859 payload = tal(openingd, struct openchannel_hook_payload);
860 payload->openingd = openingd;
861 payload->uc = uc;
862 payload->our_upfront_shutdown_script = NULL;
863 payload->errmsg = NULL;
864 if (!fromwire_openingd_got_offer(payload, msg,
865 &payload->funding_satoshis,
866 &payload->push_msat,
867 &payload->dust_limit_satoshis,
868 &payload->max_htlc_value_in_flight_msat,
869 &payload->channel_reserve_satoshis,
870 &payload->htlc_minimum_msat,
871 &payload->feerate_per_kw,
872 &payload->to_self_delay,
873 &payload->max_accepted_htlcs,
874 &payload->channel_flags,
875 &payload->shutdown_scriptpubkey,
876 &payload->channel_type)) {
877 log_broken(openingd->log, "Malformed opening_got_offer %s",
878 tal_hex(tmpctx, msg));
879 tal_free(openingd);
880 return;
881 }
882
883 /* Don't allow opening if we don't know any fees; even if
884 * ignore-feerates is set. */
885 if (unknown_feerates(openingd->ld->topology)) {
886 subd_send_msg(openingd,
887 take(towire_openingd_got_offer_reply(NULL, "Cannot accept channel: feerates unknown",
888 NULL, NULL, NULL, 0)));
889 tal_free(payload);
890 return;
891 }
892
893 tal_add_destructor2(openingd, openchannel_payload_remove_openingd, payload);
894 plugin_hook_call_openchannel(openingd->ld, NULL, payload);
895}
896
897static unsigned int openingd_msg(struct subd *openingd,
898 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