| 4603 | } |
| 4604 | |
| 4605 | struct db_stmt *payments_by_status(struct wallet *wallet, |
| 4606 | enum payment_status status, |
| 4607 | const enum wait_index *listindex, |
| 4608 | u64 liststart, |
| 4609 | const u32 *listlimit) |
| 4610 | { |
| 4611 | struct db_stmt *stmt; |
| 4612 | |
| 4613 | if (listindex && *listindex == WAIT_INDEX_UPDATED) { |
| 4614 | stmt = db_prepare_v2(wallet->db, SQL("SELECT" |
| 4615 | " id" |
| 4616 | ", updated_index" |
| 4617 | ", status" |
| 4618 | ", destination" |
| 4619 | ", msatoshi" |
| 4620 | ", payment_hash" |
| 4621 | ", timestamp" |
| 4622 | ", payment_preimage" |
| 4623 | ", path_secrets" |
| 4624 | ", route_nodes" |
| 4625 | ", route_channels" |
| 4626 | ", msatoshi_sent" |
| 4627 | ", description" |
| 4628 | ", bolt11" |
| 4629 | ", paydescription" |
| 4630 | ", failonionreply" |
| 4631 | ", total_msat" |
| 4632 | ", partid" |
| 4633 | ", local_invreq_id" |
| 4634 | ", groupid" |
| 4635 | ", completed_at" |
| 4636 | " FROM payments" |
| 4637 | " WHERE" |
| 4638 | " status = ?" |
| 4639 | " AND" |
| 4640 | " updated_index >= ?" |
| 4641 | " ORDER BY updated_index" |
| 4642 | " LIMIT ?;")); |
| 4643 | } else { |
| 4644 | stmt = db_prepare_v2(wallet->db, SQL("SELECT" |
| 4645 | " id" |
| 4646 | ", updated_index" |
| 4647 | ", status" |
| 4648 | ", destination" |
| 4649 | ", msatoshi" |
| 4650 | ", payment_hash" |
| 4651 | ", timestamp" |
| 4652 | ", payment_preimage" |
| 4653 | ", path_secrets" |
| 4654 | ", route_nodes" |
| 4655 | ", route_channels" |
| 4656 | ", msatoshi_sent" |
| 4657 | ", description" |
| 4658 | ", bolt11" |
| 4659 | ", paydescription" |
| 4660 | ", failonionreply" |
| 4661 | ", total_msat" |
| 4662 | ", partid" |
no test coverage detected