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

Function opening_got_offer

lightningd/opening_control.c:844–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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