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

Function funder_check_policy

plugins/funder_policy.c:137–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137char *funder_check_policy(const struct funder_policy *policy)
138{
139 if (policy->fund_probability > 100)
140 return "fund_probability max is 100";
141
142 if (policy->fuzz_factor > 100)
143 return "fuzz_percent max is 100";
144
145 switch (policy->opt) {
146 case FIXED:
147 /* We don't do anything for fixed */
148 return NULL;
149 case MATCH:
150 if (policy->mod > 200)
151 return "Max allowed policy_mod for 'match'"
152 " is 200";
153 return NULL;
154 case AVAILABLE:
155 if (policy->mod > 100)
156 return "Max allowed policy_mod for 'available'"
157 " is 100";
158 return NULL;
159 }
160 abort();
161}
162
163static struct amount_sat
164apply_fuzz(u32 fuzz_factor, struct amount_sat val)

Callers 2

json_funderupdateFunction · 0.85
initFunction · 0.85

Calls 1

abortFunction · 0.85

Tested by

no test coverage detected