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

Function funder_check_policy

plugins/funder_policy.c:125–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125char *funder_check_policy(const struct funder_policy *policy)
126{
127 if (policy->fund_probability > 100)
128 return "fund_probability max is 100";
129
130 if (policy->fuzz_factor > 100)
131 return "fuzz_percent max is 100";
132
133 switch (policy->opt) {
134 case FIXED:
135 /* We don't do anything for fixed */
136 return NULL;
137 case MATCH:
138 if (policy->mod > 200)
139 return "Max allowed policy_mod for 'match'"
140 " is 200";
141 return NULL;
142 case AVAILABLE:
143 if (policy->mod > 100)
144 return "Max allowed policy_mod for 'available'"
145 " is 100";
146 return NULL;
147 }
148 abort();
149}
150
151static struct amount_sat
152apply_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