MCPcopy Create free account
hub / github.com/ElementsProject/lightning / payments_first

Function payments_first

wallet/wallet.c:4505–4575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4503}
4504
4505struct db_stmt *payments_first(struct wallet *wallet,
4506 const enum wait_index *listindex,
4507 u64 liststart,
4508 const u32 *listlimit)
4509{
4510 struct db_stmt *stmt;
4511
4512 if (listindex && *listindex == WAIT_INDEX_UPDATED) {
4513 stmt = db_prepare_v2(wallet->db, SQL("SELECT"
4514 " id"
4515 ", updated_index"
4516 ", status"
4517 ", destination"
4518 ", msatoshi"
4519 ", payment_hash"
4520 ", timestamp"
4521 ", payment_preimage"
4522 ", path_secrets"
4523 ", route_nodes"
4524 ", route_channels"
4525 ", msatoshi_sent"
4526 ", description"
4527 ", bolt11"
4528 ", paydescription"
4529 ", failonionreply"
4530 ", total_msat"
4531 ", partid"
4532 ", local_invreq_id"
4533 ", groupid"
4534 ", completed_at"
4535 " FROM payments"
4536 " WHERE updated_index >= ?"
4537 " ORDER BY updated_index"
4538 " LIMIT ?;"));
4539 } else {
4540 stmt = db_prepare_v2(wallet->db, SQL("SELECT"
4541 " id"
4542 ", updated_index"
4543 ", status"
4544 ", destination"
4545 ", msatoshi"
4546 ", payment_hash"
4547 ", timestamp"
4548 ", payment_preimage"
4549 ", path_secrets"
4550 ", route_nodes"
4551 ", route_channels"
4552 ", msatoshi_sent"
4553 ", description"
4554 ", bolt11"
4555 ", paydescription"
4556 ", failonionreply"
4557 ", total_msat"
4558 ", partid"
4559 ", local_invreq_id"
4560 ", groupid"
4561 ", completed_at"
4562 " FROM payments"

Callers 1

json_listsendpaysFunction · 0.85

Calls 4

db_bind_u64Function · 0.85
db_bind_intFunction · 0.85
db_query_preparedFunction · 0.85
payments_nextFunction · 0.85

Tested by

no test coverage detected