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

Function feerate_max

lightningd/chaintopology.c:904–929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902}
903
904u32 feerate_max(struct lightningd *ld, bool *unknown)
905{
906 u32 feerate;
907 const u32 *feehistory = ld->topology->feehistory[FEERATE_MAX];
908
909 if (unknown)
910 *unknown = false;
911
912 if (ld->config.ignore_fee_limits)
913 return UINT_MAX;
914
915 /* If we don't know feerate, don't limit other side. */
916 feerate = try_get_feerate(ld->topology, FEERATE_MAX);
917 if (!feerate) {
918 if (unknown)
919 *unknown = true;
920 return UINT_MAX;
921 }
922
923 /* If one of last three was an outlier, use that. */
924 for (size_t i = 0; i < FEE_HISTORY_NUM; i++) {
925 if (feehistory[i] > feerate)
926 feerate = feehistory[i];
927 }
928 return feerate;
929}
930
931/* On shutdown, channels get deleted last. That frees from our list, so
932 * do it now instead. */

Callers 7

rbf_got_offerFunction · 0.85
accepter_got_offerFunction · 0.85
json_feeratesFunction · 0.85
peer_start_openingdFunction · 0.85
update_feeratesFunction · 0.85
peer_start_channeldFunction · 0.85
json_dev_feerateFunction · 0.85

Calls 1

try_get_feerateFunction · 0.70

Tested by

no test coverage detected