We've added a column `our_funding_satoshis`, since channels can now * have funding for either channel participant. We need to 'backfill' this * data, however. We can do this using the fact that our_funding_satoshi * is the same as the funding_satoshi for every channel where we are * the `funder` */
| 1048 | * the `funder` |
| 1049 | */ |
| 1050 | static void migrate_our_funding(struct lightningd *ld, struct db *db, |
| 1051 | const struct migration_context *mc) |
| 1052 | { |
| 1053 | struct db_stmt *stmt; |
| 1054 | |
| 1055 | /* Statement to update record */ |
| 1056 | stmt = db_prepare_v2(db, SQL("UPDATE channels" |
| 1057 | " SET our_funding_satoshi = funding_satoshi" |
| 1058 | " WHERE funder = 0;")); /* 0 == LOCAL */ |
| 1059 | db_exec_prepared_v2(stmt); |
| 1060 | if (stmt->error) |
| 1061 | db_fatal("Error migrating funding satoshis to our_funding (%s)", |
| 1062 | stmt->error); |
| 1063 | |
| 1064 | tal_free(stmt); |
| 1065 | } |
| 1066 | |
| 1067 | void fillin_missing_scriptpubkeys(struct lightningd *ld, struct db *db, |
| 1068 | const struct migration_context *mc) |
nothing calls this directly
no test coverage detected