We expect to have a few of these... */
| 771 | |
| 772 | /* We expect to have a few of these... */ |
| 773 | static void migrate_initialize_wait_indexes(struct db *db, |
| 774 | enum wait_subsystem subsystem, |
| 775 | enum wait_index index, |
| 776 | const char *query, |
| 777 | const char *colname) |
| 778 | { |
| 779 | struct db_stmt *stmt; |
| 780 | bool res; |
| 781 | |
| 782 | stmt = db_prepare_v2(db, query); |
| 783 | db_query_prepared(stmt); |
| 784 | res = db_step(stmt); |
| 785 | assert(res); |
| 786 | |
| 787 | if (!db_col_is_null(stmt, colname)) |
| 788 | db_set_intvar(db, |
| 789 | tal_fmt(tmpctx, "last_%s_%s_index", |
| 790 | wait_subsystem_name(subsystem), |
| 791 | wait_index_name(index)), |
| 792 | db_col_u64(stmt, colname)); |
| 793 | tal_free(stmt); |
| 794 | } |
| 795 | |
| 796 | void migrate_initialize_payment_wait_indexes(struct lightningd *ld, |
| 797 | struct db *db) |
no test coverage detected