listinvoice: populate local_offer_id when iterating whole db.

And add the local_offer_id to the schemas too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSONRPC: `listoffers` now shows `local_offer_id` when listing all offers.
This commit is contained in:
Rusty Russell
2021-07-01 13:58:56 +09:30
parent 68962083e7
commit 33a40ca73b
11 changed files with 33 additions and 17 deletions

View File

@@ -1131,8 +1131,8 @@ struct db_query db_postgres_queries[] = {
.readonly = false,
},
{
.name = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;",
.query = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;",
.name = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices ORDER BY id;",
.query = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices ORDER BY id;",
.placeholders = 0,
.readonly = true,
},
@@ -1924,4 +1924,4 @@ struct db_query db_postgres_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:3c0924d3409c1d356d9f90291ae54895d85f34c6a3a42388ad4fb6bfbf13820d
// SHA256STAMP:8f8494fdeb030b724d84aa26c0377e7e488ad40e4b1370db7d02470ac29c4ec8

View File

@@ -1131,8 +1131,8 @@ struct db_query db_sqlite3_queries[] = {
.readonly = false,
},
{
.name = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;",
.query = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;",
.name = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices ORDER BY id;",
.query = "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices ORDER BY id;",
.placeholders = 0,
.readonly = true,
},
@@ -1924,4 +1924,4 @@ struct db_query db_sqlite3_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
// SHA256STAMP:3c0924d3409c1d356d9f90291ae54895d85f34c6a3a42388ad4fb6bfbf13820d
// SHA256STAMP:8f8494fdeb030b724d84aa26c0377e7e488ad40e4b1370db7d02470ac29c4ec8

View File

@@ -455,6 +455,7 @@ bool invoices_iterate(struct invoices *invoices,
", bolt11"
", description"
", features"
", local_offer_id"
" FROM invoices"
" ORDER BY id;"));
db_query_prepared(stmt);

View File

@@ -747,26 +747,26 @@ msgid "DELETE FROM invoices WHERE state = ? AND expiry_time <= ?;"
msgstr ""
#: wallet/invoices.c:445
msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices ORDER BY id;"
msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices ORDER BY id;"
msgstr ""
#: wallet/invoices.c:502
#: wallet/invoices.c:503
msgid "SELECT state FROM invoices WHERE id = ?;"
msgstr ""
#: wallet/invoices.c:520
#: wallet/invoices.c:521
msgid "SELECT local_offer_id FROM invoices WHERE id = ?;"
msgstr ""
#: wallet/invoices.c:552
#: wallet/invoices.c:553
msgid "UPDATE invoices SET state=? , pay_index=? , msatoshi_received=? , paid_timestamp=? WHERE id=?;"
msgstr ""
#: wallet/invoices.c:611
#: wallet/invoices.c:612
msgid "SELECT id FROM invoices WHERE pay_index IS NOT NULL AND pay_index > ? ORDER BY pay_index ASC LIMIT 1;"
msgstr ""
#: wallet/invoices.c:660
#: wallet/invoices.c:661
msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features, local_offer_id FROM invoices WHERE id = ?;"
msgstr ""
@@ -1269,4 +1269,4 @@ msgstr ""
#: wallet/test/run-wallet.c:1649
msgid "INSERT INTO channels (id) VALUES (1);"
msgstr ""
# SHA256STAMP:913e7b10afc4160e8b437a2c54839d996a94667fc0c00a22f3ca97856491ac72
# SHA256STAMP:cc1be3f6b134130e9c0251467bd7ecb8a7cdb20f3026bdd26fcf5b286872ef2c