| 330 | } |
| 331 | |
| 332 | void payment_succeeded(struct lightningd *ld, struct htlc_out *hout, |
| 333 | const struct preimage *rval) |
| 334 | { |
| 335 | struct wallet_payment *payment; |
| 336 | |
| 337 | wallet_payment_set_status(ld->wallet, &hout->payment_hash, |
| 338 | hout->partid, hout->groupid, |
| 339 | PAYMENT_COMPLETE, rval); |
| 340 | payment = wallet_payment_by_hash(tmpctx, ld->wallet, |
| 341 | &hout->payment_hash, |
| 342 | hout->partid, hout->groupid); |
| 343 | assert(payment); |
| 344 | |
| 345 | if (payment->local_offer_id) |
| 346 | wallet_offer_mark_used(ld->wallet->db, payment->local_offer_id); |
| 347 | tell_waiters_success(ld, &hout->payment_hash, payment); |
| 348 | } |
| 349 | |
| 350 | /* Return a struct routing_failure for an immediate failure |
| 351 | * (returned directly from send_htlc_out). The returned |
no test coverage detected