| 237 | } |
| 238 | |
| 239 | static bool attempt_ongoing(const struct sha256 *payment_hash) |
| 240 | { |
| 241 | struct payment *root; |
| 242 | struct payment_tree_result res; |
| 243 | enum payment_step diff, |
| 244 | final_states = PAYMENT_STEP_FAILED | PAYMENT_STEP_SUCCESS; |
| 245 | |
| 246 | list_for_each(&payments, root, list) { |
| 247 | if (!sha256_eq(payment_hash, root->payment_hash)) |
| 248 | continue; |
| 249 | res = payment_collect_result(root); |
| 250 | diff = res.leafstates & ~final_states; |
| 251 | return diff != 0; |
| 252 | } |
| 253 | return false; |
| 254 | } |
| 255 | |
| 256 | /* A unique key for each payment attempt, even if the same invoice was |
| 257 | * attempted multiple times. */ |
no test coverage detected