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

Function adopt_opening_candidate

lightningd/peer_control.c:2666–2681  ·  view source on GitHub ↗

A dual-funding candidate was mined and spent before lock-in. */

Source from the content-addressed store, hash-verified

2664
2665/* A dual-funding candidate was mined and spent before lock-in. */
2666static void adopt_opening_candidate(struct channel *channel,
2667 const struct channel_inflight *inflight)
2668{
2669 struct amount_msat our_msat;
2670
2671 log_unusual(channel->log,
2672 "Candidate funding %s spent before lock-in; adopting it",
2673 fmt_bitcoin_outpoint(tmpctx, &inflight->funding->outpoint));
2674 update_channel_from_inflight(channel->peer->ld, channel, inflight,
2675 false);
2676 if (amount_sat_to_msat(&our_msat, channel->our_funds)) {
2677 channel->our_msat = our_msat;
2678 channel->msat_to_us_min = our_msat;
2679 channel->msat_to_us_max = our_msat;
2680 }
2681}
2682
2683/* A splice candidate was mined and spent before splice_locked, which
2684 * needs the peer: do what handle_peer_splice_locked() would have. */

Callers 1

funding_spentFunction · 0.85

Calls 3

fmt_bitcoin_outpointFunction · 0.85
amount_sat_to_msatFunction · 0.50

Tested by

no test coverage detected