This allows us to mark an offer used when an invoice derived from it
is paid, and importantly, avoid any other invoices for the offer being
paid.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
.name="SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = ?;",
.query="SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = $1;",
.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 WHERE 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 WHERE id = $1;",
.name="SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = ?;",
.query="SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE 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 WHERE 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 WHERE id = ?;",
msgid "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?"
msgstr ""
#: wallet/db.c:993
#: wallet/db.c:995
msgid "SELECT version FROM version LIMIT 1"
msgstr ""
#: wallet/db.c:1051
#: wallet/db.c:1053
msgid "UPDATE version SET version=?;"
msgstr ""
#: wallet/db.c:1059
#: wallet/db.c:1061
msgid "INSERT INTO db_upgrades VALUES (?, ?);"
msgstr ""
#: wallet/db.c:1071
#: wallet/db.c:1073
msgid "SELECT intval FROM vars WHERE name = 'data_version'"
msgstr ""
#: wallet/db.c:1098
#: wallet/db.c:1100
msgid "SELECT intval FROM vars WHERE name= ? LIMIT 1"
msgstr ""
#: wallet/db.c:1114
#: wallet/db.c:1116
msgid "UPDATE vars SET intval=? WHERE name=?;"
msgstr ""
#: wallet/db.c:1123
#: wallet/db.c:1125
msgid "INSERT INTO vars (name, intval) VALUES (?, ?);"
msgstr ""
#: wallet/db.c:1137
#: wallet/db.c:1139
msgid "UPDATE channels SET feerate_base = ?, feerate_ppm = ?;"
msgstr ""
#: wallet/db.c:1158
#: wallet/db.c:1160
msgid "UPDATE channels SET our_funding_satoshi = funding_satoshi WHERE funder = 0;"
msgstr ""
#: wallet/db.c:1174
#: wallet/db.c:1176
msgid "SELECT type, keyindex, prev_out_tx, prev_out_index, channel_id, peer_id, commitment_point FROM outputs WHERE scriptpubkey IS NULL;"
msgstr ""
#: wallet/db.c:1236
#: wallet/db.c:1238
msgid "UPDATE outputs SET scriptpubkey = ? WHERE prev_out_tx = ? AND prev_out_index = ?"
msgstr ""
#: wallet/db.c:1261
#: wallet/db.c:1263
msgid "SELECT id, funding_tx_id, funding_tx_outnum FROM channels;"
msgstr ""
#: wallet/db.c:1280
#: wallet/db.c:1282
msgid "UPDATE channels SET full_channel_id = ? WHERE id = ?;"
msgstr ""
#: wallet/db.c:1303
#: wallet/db.c:1305
msgid "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;"
msgstr ""
#: wallet/db.c:1370
#: wallet/db.c:1372
msgid "UPDATE channels SET last_tx = ? WHERE id = ?;"
msgstr ""
#: wallet/invoices.c:129
#: wallet/invoices.c:135
msgid "UPDATE invoices SET state = ? WHERE state = ? AND expiry_time <= ?;"
msgstr ""
#: wallet/invoices.c:177
#: wallet/invoices.c:183
msgid "SELECT id FROM invoices WHERE state = ? AND expiry_time <= ?"
msgstr ""
#: wallet/invoices.c:216
#: wallet/invoices.c:222
msgid "SELECT MIN(expiry_time) FROM invoices WHERE state = ?;"
msgid "SELECT id FROM invoices WHERE payment_hash = ?;"
msgstr ""
#: wallet/invoices.c:373
#: wallet/invoices.c:384
msgid "SELECT id FROM invoices WHERE payment_hash = ? AND state = ?;"
msgstr ""
#: wallet/invoices.c:397
#: wallet/invoices.c:408
msgid "DELETE FROM invoices WHERE id=?;"
msgstr ""
#: wallet/invoices.c:417
#: wallet/invoices.c:428
msgid "DELETE FROM invoices WHERE state = ? AND expiry_time <= ?;"
msgstr ""
#: wallet/invoices.c:431
#: wallet/invoices.c:442
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;"
msgstr ""
#: wallet/invoices.c:488
#: wallet/invoices.c:499
msgid "SELECT state FROM invoices WHERE id = ?;"
msgstr ""
#: wallet/invoices.c:516
#: wallet/invoices.c:517
msgid "SELECT local_offer_id FROM invoices WHERE id = ?;"
msgstr ""
#: wallet/invoices.c:549
msgid "UPDATE invoices SET state=? , pay_index=? , msatoshi_received=? , paid_timestamp=? WHERE id=?;"
msgstr ""
#: wallet/invoices.c:573
#: wallet/invoices.c:608
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:622
msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = ?;"
#: wallet/invoices.c:657
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 ""
#: wallet/wallet.c:75 wallet/wallet.c:553
@ -906,231 +914,231 @@ msgstr ""
msgid "SELECT id, channel_htlc_id, msatoshi, cltv_expiry, hstate, payment_hash, payment_key, routing_onion, failuremsg, malformed_onion, origin_htlc, shared_secret, received_time, partid, localfailmsg FROM channel_htlcs WHERE direction = ? AND channel_id = ? AND hstate != ?"
msgstr ""
#: wallet/wallet.c:2378
#: wallet/wallet.c:2379
msgid "SELECT channel_id, direction, cltv_expiry, channel_htlc_id, payment_hash FROM channel_htlcs WHERE channel_id = ?;"
msgstr ""
#: wallet/wallet.c:2412
#: wallet/wallet.c:2413
msgid "DELETE FROM channel_htlcs WHERE direction = ? AND origin_htlc = ? AND payment_hash = ? AND partid = ?;"
msgstr ""
#: wallet/wallet.c:2465
#: wallet/wallet.c:2466
msgid "SELECT status FROM payments WHERE payment_hash=? AND partid = ?;"
msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;"
msgstr ""
#: wallet/wallet.c:3541
#: wallet/wallet.c:3542
msgid "SELECT c.type, c.blockheight, t.rawtx, c.input_num, c.blockheight - t.blockheight + 1 AS depth, t.id as txid FROM channeltxs c JOIN transactions t ON t.id = c.transaction_id WHERE c.channel_id = ? ORDER BY c.id ASC;"
msgstr ""
#: wallet/wallet.c:3586
#: wallet/wallet.c:3587
msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?"
msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;"
msgstr ""
#: wallet/wallet.c:3727
#: wallet/wallet.c:3728
msgid "SELECT f.state, in_msatoshi, out_msatoshi, hin.payment_hash as payment_hash, in_channel_scid, out_channel_scid, f.received_time, f.resolved_time, f.failcode FROM forwarded_payments f LEFT JOIN channel_htlcs hin ON (f.in_htlc_id = hin.id)"
msgstr ""
#: wallet/wallet.c:3815
#: wallet/wallet.c:3816
msgid "SELECT t.id, t.rawtx, t.blockheight, t.txindex, t.type as txtype, c2.short_channel_id as txchan, a.location, a.idx as ann_idx, a.type as annotation_type, c.short_channel_id FROM transactions t LEFT JOIN transaction_annotations a ON (a.txid = t.id) LEFT JOIN channels c ON (a.channel = c.id) LEFT JOIN channels c2 ON (t.channel_id = c2.id) ORDER BY t.blockheight, t.txindex ASC"