db: Add migration for the local basepoints and the funding pubkey

This commit is contained in:
Christian Decker
2021-03-01 15:47:55 +01:00
committed by Rusty Russell
parent bc42e8df13
commit 4887a5a18f
6 changed files with 282 additions and 176 deletions

View File

@@ -1010,6 +1010,18 @@ struct db_query db_sqlite3_queries[] = {
.placeholders = 2,
.readonly = false,
},
{
.name = "SELECT channels.id, peers.node_id FROM channels JOIN peers ON (peers.id = channels.peer_id)",
.query = "SELECT channels.id, peers.node_id FROM channels JOIN peers ON (peers.id = channels.peer_id)",
.placeholders = 0,
.readonly = true,
},
{
.name = "UPDATE channels SET revocation_basepoint_local = ?, payment_basepoint_local = ?, htlc_basepoint_local = ?, delayed_payment_basepoint_local = ?, funding_pubkey_local = ? WHERE id = ?;",
.query = "UPDATE channels SET revocation_basepoint_local = ?, payment_basepoint_local = ?, htlc_basepoint_local = ?, delayed_payment_basepoint_local = ?, funding_pubkey_local = ? WHERE id = ?;",
.placeholders = 6,
.readonly = false,
},
{
.name = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
.query = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
@@ -1858,10 +1870,10 @@ struct db_query db_sqlite3_queries[] = {
},
};
#define DB_SQLITE3_QUERY_COUNT 308
#define DB_SQLITE3_QUERY_COUNT 310
#endif /* HAVE_SQLITE3 */
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
// SHA256STAMP:90340a79e7d9009f7903f4c203253632ef2e81704d8e403f9bbffec2ed34dcb6
// SHA256STAMP:9b64275f5e8b221e0e7ae99a386d0fb5c5112b65eb893dc6c8f68c2e95d920d4