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

Function add_payment_hash_desc

plugins/bkpr/recorder.c:631–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631void add_payment_hash_desc(struct db *db,
632 struct sha256 *payment_hash,
633 const char *desc)
634{
635 struct db_stmt *stmt;
636
637 /* Ok, now we update the account with this blockheight */
638 stmt = db_prepare_v2(db, SQL("UPDATE channel_events SET"
639 " ev_desc = ?"
640 " WHERE"
641 " payment_id = ?"));
642 db_bind_text(stmt, 0, desc);
643 db_bind_sha256(stmt, 1, payment_hash);
644 db_exec_prepared_v2(take(stmt));
645
646 /* Ok, now we update the account with this blockheight */
647 stmt = db_prepare_v2(db, SQL("UPDATE chain_events SET"
648 " ev_desc = ?"
649 " WHERE"
650 " payment_id = ?"));
651 db_bind_text(stmt, 0, desc);
652 db_bind_sha256(stmt, 1, payment_hash);
653 db_exec_prepared_v2(take(stmt));
654}
655
656struct chain_event *find_chain_event_by_id(const tal_t *ctx,
657 struct db *db,

Callers 2

listinvoice_doneFunction · 0.85
listsendpays_doneFunction · 0.85

Calls 3

db_bind_textFunction · 0.85
db_bind_sha256Function · 0.85
db_exec_prepared_v2Function · 0.85

Tested by

no test coverage detected