| 135 | } |
| 136 | |
| 137 | char *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 | |
| 163 | static struct amount_sat |
| 164 | apply_fuzz(u32 fuzz_factor, struct amount_sat val) |
no test coverage detected