| 123 | } |
| 124 | |
| 125 | char *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 | |
| 151 | static struct amount_sat |
| 152 | apply_fuzz(u32 fuzz_factor, struct amount_sat val) |
no test coverage detected