| 309 | } |
| 310 | |
| 311 | static void tell_waiters_success(struct lightningd *ld, |
| 312 | const struct sha256 *payment_hash, |
| 313 | struct wallet_payment *payment) |
| 314 | { |
| 315 | struct sendpay_command *pc; |
| 316 | struct sendpay_command *next; |
| 317 | |
| 318 | /* Careful: sendpay_success deletes cmd */ |
| 319 | list_for_each_safe(&ld->waitsendpay_commands, pc, next, list) { |
| 320 | if (!sha256_eq(payment_hash, &pc->payment_hash)) |
| 321 | continue; |
| 322 | if (payment->partid != pc->partid) |
| 323 | continue; |
| 324 | if (payment->groupid != pc->groupid) |
| 325 | continue; |
| 326 | |
| 327 | sendpay_success(pc->cmd, payment); |
| 328 | } |
| 329 | notify_sendpay_success(ld, payment); |
| 330 | } |
| 331 | |
| 332 | void payment_succeeded(struct lightningd *ld, struct htlc_out *hout, |
| 333 | const struct preimage *rval) |
no test coverage detected