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

Function minconf_to_maxheight

wallet/reservation.c:427–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427static inline u32 minconf_to_maxheight(u32 minconf, struct lightningd *ld)
428{
429 /* No confirmations is special, we need to disable the check in the
430 * selection */
431 if (minconf == 0)
432 return 0;
433
434 /* Avoid wrapping around and suddenly allowing any confirmed
435 * outputs. Since we can't have a coinbase output, and 0 is taken for
436 * the disable case, we can just clamp to 1. */
437 if (minconf >= ld->topology->tip->height)
438 return 1;
439 return ld->topology->tip->height - minconf + 1;
440}
441
442/* Returns false if it needed to create change, but couldn't afford. */
443static bool change_for_emergency(struct lightningd *ld,

Callers 2

json_fundpsbtFunction · 0.85
json_addpsbtinputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected