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

Function invoices_create_fallback

wallet/invoices.c:384–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void invoices_create_fallback(struct invoices *invoices,
385 u64 inv_dbid,
386 const u8 *scriptPubkey)
387{
388 struct db_stmt *stmt;
389
390 /* Save to database. */
391 stmt = db_prepare_v2(
392 invoices->wallet->db,
393 SQL("INSERT INTO invoice_fallbacks"
394 " ( invoice_id, scriptpubkey )"
395 " VALUES ( ?, ?);"));
396
397 db_bind_u64(stmt, inv_dbid);
398 db_bind_blob(stmt, scriptPubkey,
399 tal_bytelen(scriptPubkey));
400 db_exec_prepared_v2(stmt);
401 tal_free(stmt);
402}
403
404bool invoices_find_by_fallback_script(struct invoices *invoices,
405 u64 *inv_dbid,

Callers

nothing calls this directly

Calls 5

db_bind_u64Function · 0.85
db_bind_blobFunction · 0.85
tal_bytelenFunction · 0.85
db_exec_prepared_v2Function · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected