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

Function feerate_min

lightningd/chaintopology.c:873–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873u32 feerate_min(struct lightningd *ld, bool *unknown)
874{
875 u32 min;
876
877 if (unknown)
878 *unknown = false;
879
880 /* We can't allow less than feerate_floor, since that won't relay */
881 if (ld->config.ignore_fee_limits)
882 min = 1;
883 else {
884 min = try_get_feerate(ld->topology, FEERATE_MIN);
885 if (!min) {
886 if (unknown)
887 *unknown = true;
888 } else {
889 const u32 *hist = ld->topology->feehistory[FEERATE_MIN];
890
891 /* If one of last three was an outlier, use that. */
892 for (size_t i = 0; i < FEE_HISTORY_NUM; i++) {
893 if (hist[i] < min)
894 min = hist[i];
895 }
896 }
897 }
898
899 if (min < feerate_floor())
900 return feerate_floor();
901 return min;
902}
903
904u32 feerate_max(struct lightningd *ld, bool *unknown)
905{

Callers 10

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

Calls 2

feerate_floorFunction · 0.85
try_get_feerateFunction · 0.70

Tested by

no test coverage detected