| 336 | } |
| 337 | |
| 338 | static void tell_waiters_success(struct lightningd *ld, |
| 339 | const struct sha256 *payment_hash, |
| 340 | struct wallet_payment *payment) |
| 341 | { |
| 342 | struct waitsendpay_command *pc; |
| 343 | struct waitsendpay_command *next; |
| 344 | |
| 345 | /* Careful: sendpay_success deletes cmd */ |
| 346 | list_for_each_safe(&ld->waitsendpay_commands, pc, next, list) { |
| 347 | if (!sha256_eq(payment_hash, &pc->payment_hash)) |
| 348 | continue; |
| 349 | if (payment->partid != pc->partid) |
| 350 | continue; |
| 351 | if (payment->groupid != pc->groupid) |
| 352 | continue; |
| 353 | |
| 354 | pc->success(pc->cmd, payment, pc->arg); |
| 355 | } |
| 356 | notify_sendpay_success(ld, payment); |
| 357 | } |
| 358 | |
| 359 | void payment_succeeded(struct lightningd *ld, |
| 360 | const struct sha256 *payment_hash, |
no test coverage detected