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

Function payments_first

wallet/wallet.c:4463–4533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4461}
4462
4463struct db_stmt *payments_first(struct wallet *wallet,
4464 const enum wait_index *listindex,
4465 u64 liststart,
4466 const u32 *listlimit)
4467{
4468 struct db_stmt *stmt;
4469
4470 if (listindex && *listindex == WAIT_INDEX_UPDATED) {
4471 stmt = db_prepare_v2(wallet->db, SQL("SELECT"
4472 " id"
4473 ", updated_index"
4474 ", status"
4475 ", destination"
4476 ", msatoshi"
4477 ", payment_hash"
4478 ", timestamp"
4479 ", payment_preimage"
4480 ", path_secrets"
4481 ", route_nodes"
4482 ", route_channels"
4483 ", msatoshi_sent"
4484 ", description"
4485 ", bolt11"
4486 ", paydescription"
4487 ", failonionreply"
4488 ", total_msat"
4489 ", partid"
4490 ", local_invreq_id"
4491 ", groupid"
4492 ", completed_at"
4493 " FROM payments"
4494 " WHERE updated_index >= ?"
4495 " ORDER BY updated_index"
4496 " LIMIT ?;"));
4497 } else {
4498 stmt = db_prepare_v2(wallet->db, SQL("SELECT"
4499 " id"
4500 ", updated_index"
4501 ", status"
4502 ", destination"
4503 ", msatoshi"
4504 ", payment_hash"
4505 ", timestamp"
4506 ", payment_preimage"
4507 ", path_secrets"
4508 ", route_nodes"
4509 ", route_channels"
4510 ", msatoshi_sent"
4511 ", description"
4512 ", bolt11"
4513 ", paydescription"
4514 ", failonionreply"
4515 ", total_msat"
4516 ", partid"
4517 ", local_invreq_id"
4518 ", groupid"
4519 ", completed_at"
4520 " 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