lightningd: expose created_index and updated_index fields.

If you miss a wait event, you can catch up by doing listinvoices and
getting the max of these fields.  It's also a good debugging clue.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-07-22 20:29:17 +09:30
parent 284262d006
commit d25a8ca0fd
27 changed files with 559 additions and 325 deletions

View File

@@ -111,7 +111,8 @@ static struct invoice_details *wallet_stmt2invoice_details(const tal_t *ctx,
dtl->features = db_col_arr(dtl, stmt, "features", u8);
dtl->local_offer_id = db_col_optional(dtl, stmt, "local_offer_id", sha256);
dtl->created_index = db_col_u64(stmt, "id");
dtl->updated_index = db_col_u64(stmt, "updated_index");
return dtl;
}
@@ -706,6 +707,8 @@ struct invoice_details *invoices_get_details(const tal_t *ctx,
", description"
", features"
", local_offer_id"
", id"
", updated_index"
" FROM invoices"
" WHERE id = ?;"));
db_bind_u64(stmt, inv_dbid);