From 2f6e33a7cdfb6b78421177938a7906462cd0b6e7 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 26 Feb 2021 17:12:56 +0100 Subject: [PATCH] wallet: Add migration to cache local basepoints from the HSMd --- tests/data/no-local-basepoints.sqlite3.xz | Bin 0 -> 5612 bytes tests/test_db.py | 48 + wallet/db.c | 5 + wallet/db_postgres_sqlgen.c | 34 +- wallet/db_sqlite3_sqlgen.c | 34 +- wallet/statements.po | 1039 --------------------- wallet/statements_gettextgen.po | 54 +- 7 files changed, 154 insertions(+), 1060 deletions(-) create mode 100644 tests/data/no-local-basepoints.sqlite3.xz delete mode 100644 wallet/statements.po diff --git a/tests/data/no-local-basepoints.sqlite3.xz b/tests/data/no-local-basepoints.sqlite3.xz new file mode 100644 index 0000000000000000000000000000000000000000..15af107e0da78452a4b336b1ee34333d18e46f3b GIT binary patch literal 5612 zcmVvSRMV(;C8Tck-h>j-y zF_rzthkyo`yX=3c34nmGBy*@;V=NZ2N^CMt33-n44U1yABz`f-O;J-&*%%C~P{O(n zX0fJS?w$}Q%V7_oZ9p?%lC6T35KB=%e*RJgf2=G&b79o{#%|gpXBd;?OL-tc>+e=Q z_4TGv0)&?Yf6W0ur1tBXA6Urdt!81+h&;~lh4RG_ISRToI1PH4o)r^-cF6H*#96>4 zgpiNp_9lwcFU~$9C`B}KAGFbhFAZ6!t&IxKWM>^>4dP}u;^Rt{LPg&vyF(pE<3;ZKWEi|vW{cNV#DkX{Wl@AC1DEuK!4 zVx&cjG*37$^0EYKlX*{`y>^l)3yP)AhVFTi?Lp?`d#EeSX(7-Cl}Opagt8D>{Ve%n zPn{BLy>|YvYme1f0_Njb={Yl81*&r*TYJ9q2>rj>2-a(EI_~sW?}sWWD51=|uJg+g zy=`RQNPAP~cNh1Mw*b=?7+A}PmG#@go{lGq1o{m{zjRN~xDcAjfe>l1i2;}167gtD zcO~=2UGIWoPb2lX6L&sGQpV*%(2-trd#9mq=by(L9xe z6F>$rb%$g;US8b*Oi7B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iskSpS9|mD7oFxr#ZrANJ2yF9!$?+G+a<@NK2~ zEd?FwDm(g^;6xlJX90p-fYvrPQ+`UMH!5qEduwm;?U-Bz^3ip(E z*;u^hqa>FZtEqkmW?YXJA>Vl-hw;OL34`C&@+!S4-t_|N${S|v<>+=!_x!75@e z!hW?$qAEJI_W%YiVx3uI82bY76V1X;k;1ufbmRmAUMF7!r^USG=g%3r2?HgcWW{l! zI#50DF^ny_sHZic-)N)D%m;)rYi4-TPw_K)``e~dUugtmIz-FO&KCaKzq0&94) ztqd(8P%+$nXgDJ@owdoz#ltT(!DQXmKnhq6seQ6tHu@~997Mt&?vKa{q@F3 zvtZ01gqqQ#&k)?k@)P106J%jw7}}C5cgJiTpBeGdcuHH2us`U}g^nb`9zHCFw)YZH zF$Ae=vgjEAW|i!vvx_l)bD#q=_Lm||ZOSjDbUI{`bl>Tv}!h7zjKna_hSX;nDKL-<6495k_4cVEw0_&?}ey<0+~*p!2N4EB^@djuPU;HtjCfS;x%Akd~QmPBfN4iU!ev;ow`c8@381iu7BsT z?pO8$ICsQtI2J0ln4w8{#X{Tw00009oOLPhIV98o0mUnTpbP+*;q|Ps#Ao{g00000 G1X)@Oc-Pnf literal 0 HcmV?d00001 diff --git a/tests/test_db.py b/tests/test_db.py index 857b1422a..c188373dc 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -298,3 +298,51 @@ def test_psql_key_value_dsn(node_factory, db_provider, monkeypatch): l1 = node_factory.get_node() opt = [o for o in l1.daemon.cmd_line if '--wallet' in o][0] assert('host=127.0.0.1' in opt) + + +@unittest.skipIf( + TEST_NETWORK != 'regtest', + "The DB migration is network specific due to the chain var." +) +@unittest.skipIf( + os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', + "This test is based on a sqlite3 snapshot" +) +def test_local_basepoints_cache(bitcoind, node_factory): + """XXX started caching the local basepoints as well as the remote ones. + + This tests that we can successfully migrate a DB from the + pre-caching state to the caching state, by simply starting the + node up once, issue the HSMd requests, and then store them in the + DB. + + """ + # Reestablish the blockheight we had when generating the DB + bitcoind.generate_block(6) + l1 = node_factory.get_node( + dbfile='no-local-basepoints.sqlite3.xz', + start=False + ) + + fields = [ + "revocation_basepoint_local", + "payment_basepoint_local", + "htlc_basepoint_local", + "delayed_payment_basepoint_local", + ] + q = "SELECT {fields} FROM channels".format(fields=", ".join(fields)) + + # Make sure the DB doesn't have the fields yet. + missing = l1.db.query("SELECT * FROM channels")[0] + for f in fields: + assert(f not in missing) + + # Starting this should cause us to migrate the DB, but none of + # these fields will be set. + l1.start() + + present = l1.db.query(q)[0] + for f in fields: + assert(f in present) + assert(present[f] is None) + diff --git a/wallet/db.c b/wallet/db.c index 23bb46df1..0d3f51467 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -690,6 +690,11 @@ static struct migration dbmigrations[] = { ", PRIMARY KEY (channel_id, funding_tx_id)" ");"), NULL}, + {SQL("ALTER TABLE channels ADD revocation_basepoint_local BLOB"), NULL}, + {SQL("ALTER TABLE channels ADD payment_basepoint_local BLOB"), NULL}, + {SQL("ALTER TABLE channels ADD htlc_basepoint_local BLOB"), NULL}, + {SQL("ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB"), NULL}, + {SQL("ALTER TABLE channels ADD funding_pubkey_local BLOB"), NULL}, }; /* Leak tracking. */ diff --git a/wallet/db_postgres_sqlgen.c b/wallet/db_postgres_sqlgen.c index 02ad34244..c040ca46c 100644 --- a/wallet/db_postgres_sqlgen.c +++ b/wallet/db_postgres_sqlgen.c @@ -896,6 +896,36 @@ struct db_query db_postgres_queries[] = { .placeholders = 0, .readonly = false, }, + { + .name = "ALTER TABLE channels ADD revocation_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD revocation_basepoint_local BYTEA", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD payment_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD payment_basepoint_local BYTEA", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD htlc_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD htlc_basepoint_local BYTEA", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD delayed_payment_basepoint_local BYTEA", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD funding_pubkey_local BLOB", + .query = "ALTER TABLE channels ADD funding_pubkey_local BYTEA", + .placeholders = 0, + .readonly = false, + }, { .name = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?", .query = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = $1", @@ -1828,10 +1858,10 @@ struct db_query db_postgres_queries[] = { }, }; -#define DB_POSTGRES_QUERY_COUNT 303 +#define DB_POSTGRES_QUERY_COUNT 308 #endif /* HAVE_POSTGRES */ #endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */ -// SHA256STAMP:984787ceecca007210a6b465695a1fc910b7f9899ac98cdf2eae35e417bc6cf2 +// SHA256STAMP:f821e078a09daf59ba061f0a2098510f136efa4b70fa046aa9b2f5de2f0160ed diff --git a/wallet/db_sqlite3_sqlgen.c b/wallet/db_sqlite3_sqlgen.c index dacd1e8b3..5739f0f0c 100644 --- a/wallet/db_sqlite3_sqlgen.c +++ b/wallet/db_sqlite3_sqlgen.c @@ -896,6 +896,36 @@ struct db_query db_sqlite3_queries[] = { .placeholders = 0, .readonly = false, }, + { + .name = "ALTER TABLE channels ADD revocation_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD revocation_basepoint_local BLOB", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD payment_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD payment_basepoint_local BLOB", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD htlc_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD htlc_basepoint_local BLOB", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB", + .query = "ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB", + .placeholders = 0, + .readonly = false, + }, + { + .name = "ALTER TABLE channels ADD funding_pubkey_local BLOB", + .query = "ALTER TABLE channels ADD funding_pubkey_local BLOB", + .placeholders = 0, + .readonly = false, + }, { .name = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?", .query = "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?", @@ -1828,10 +1858,10 @@ struct db_query db_sqlite3_queries[] = { }, }; -#define DB_SQLITE3_QUERY_COUNT 303 +#define DB_SQLITE3_QUERY_COUNT 308 #endif /* HAVE_SQLITE3 */ #endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */ -// SHA256STAMP:984787ceecca007210a6b465695a1fc910b7f9899ac98cdf2eae35e417bc6cf2 +// SHA256STAMP:f821e078a09daf59ba061f0a2098510f136efa4b70fa046aa9b2f5de2f0160ed diff --git a/wallet/statements.po b/wallet/statements.po deleted file mode 100644 index c124b231a..000000000 --- a/wallet/statements.po +++ /dev/null @@ -1,1039 +0,0 @@ -#: wallet/db.c:29 -msgid "CREATE TABLE version (version INTEGER)" -msgstr "" - -#: wallet/db.c:30 -msgid "INSERT INTO version VALUES (1)" -msgstr "" - -#: wallet/db.c:31 -msgid "CREATE TABLE outputs ( prev_out_tx BLOB, prev_out_index INTEGER, value BIGINT, type INTEGER, status INTEGER, keyindex INTEGER, PRIMARY KEY (prev_out_tx, prev_out_index));" -msgstr "" - -#: wallet/db.c:40 -msgid "CREATE TABLE vars ( name VARCHAR(32), val VARCHAR(255), PRIMARY KEY (name));" -msgstr "" - -#: wallet/db.c:46 -msgid "CREATE TABLE shachains ( id BIGSERIAL, min_index BIGINT, num_valid BIGINT, PRIMARY KEY (id));" -msgstr "" - -#: wallet/db.c:53 -msgid "CREATE TABLE shachain_known ( shachain_id BIGINT REFERENCES shachains(id) ON DELETE CASCADE, pos INTEGER, idx BIGINT, hash BLOB, PRIMARY KEY (shachain_id, pos));" -msgstr "" - -#: wallet/db.c:61 -msgid "CREATE TABLE peers ( id BIGSERIAL, node_id BLOB UNIQUE, address TEXT, PRIMARY KEY (id));" -msgstr "" - -#: wallet/db.c:68 -msgid "CREATE TABLE channels ( id BIGSERIAL, peer_id BIGINT REFERENCES peers(id) ON DELETE CASCADE, short_channel_id TEXT, channel_config_local BIGINT, channel_config_remote BIGINT, state INTEGER, funder INTEGER, channel_flags INTEGER, minimum_depth INTEGER, next_index_local BIGINT, next_index_remote BIGINT, next_htlc_id BIGINT, funding_tx_id BLOB, funding_tx_outnum INTEGER, funding_satoshi BIGINT, funding_locked_remote INTEGER, push_msatoshi BIGINT, msatoshi_local BIGINT, fundingkey_remote BLOB, revocation_basepoint_remote BLOB, payment_basepoint_remote BLOB, htlc_basepoint_remote BLOB, delayed_payment_basepoint_remote BLOB, per_commit_remote BLOB, old_per_commit_remote BLOB, local_feerate_per_kw INTEGER, remote_feerate_per_kw INTEGER, shachain_remote_id BIGINT, shutdown_scriptpubkey_remote BLOB, shutdown_keyidx_local BIGINT, last_sent_commit_state BIGINT, last_sent_commit_id INTEGER, last_tx BLOB, last_sig BLOB, closing_fee_received INTEGER, closing_sig_received BLOB, PRIMARY KEY (id));" -msgstr "" - -#: wallet/db.c:110 -msgid "CREATE TABLE channel_configs ( id BIGSERIAL, dust_limit_satoshis BIGINT, max_htlc_value_in_flight_msat BIGINT, channel_reserve_satoshis BIGINT, htlc_minimum_msat BIGINT, to_self_delay INTEGER, max_accepted_htlcs INTEGER, PRIMARY KEY (id));" -msgstr "" - -#: wallet/db.c:121 -msgid "CREATE TABLE channel_htlcs ( id BIGSERIAL, channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, channel_htlc_id BIGINT, direction INTEGER, origin_htlc BIGINT, msatoshi BIGINT, cltv_expiry INTEGER, payment_hash BLOB, payment_key BLOB, routing_onion BLOB, failuremsg BLOB, malformed_onion INTEGER, hstate INTEGER, shared_secret BLOB, PRIMARY KEY (id), UNIQUE (channel_id, channel_htlc_id, direction));" -msgstr "" - -#: wallet/db.c:141 -msgid "CREATE TABLE invoices ( id BIGSERIAL, state INTEGER, msatoshi BIGINT, payment_hash BLOB, payment_key BLOB, label TEXT, PRIMARY KEY (id), UNIQUE (label), UNIQUE (payment_hash));" -msgstr "" - -#: wallet/db.c:153 -msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, direction INTEGER, destination BLOB, msatoshi BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash));" -msgstr "" - -#: wallet/db.c:166 -msgid "ALTER TABLE invoices ADD expiry_time BIGINT;" -msgstr "" - -#: wallet/db.c:167 -msgid "UPDATE invoices SET expiry_time=9223372036854775807;" -msgstr "" - -#: wallet/db.c:169 -msgid "ALTER TABLE invoices ADD pay_index BIGINT;" -msgstr "" - -#: wallet/db.c:170 -msgid "CREATE UNIQUE INDEX invoices_pay_index ON invoices(pay_index);" -msgstr "" - -#: wallet/db.c:172 -msgid "UPDATE invoices SET pay_index=id WHERE state=1;" -msgstr "" - -#: wallet/db.c:175 -msgid "INSERT INTO vars(name, val) VALUES('next_pay_index', COALESCE((SELECT MAX(pay_index) FROM invoices WHERE state=1), 0) + 1 );" -msgstr "" - -#: wallet/db.c:184 -msgid "ALTER TABLE channels ADD first_blocknum BIGINT;" -msgstr "" - -#: wallet/db.c:185 -msgid "UPDATE channels SET first_blocknum=1 WHERE short_channel_id IS NOT NULL;" -msgstr "" - -#: wallet/db.c:187 -msgid "ALTER TABLE outputs ADD COLUMN channel_id BIGINT;" -msgstr "" - -#: wallet/db.c:188 -msgid "ALTER TABLE outputs ADD COLUMN peer_id BLOB;" -msgstr "" - -#: wallet/db.c:189 -msgid "ALTER TABLE outputs ADD COLUMN commitment_point BLOB;" -msgstr "" - -#: wallet/db.c:190 -msgid "ALTER TABLE invoices ADD COLUMN msatoshi_received BIGINT;" -msgstr "" - -#: wallet/db.c:192 -msgid "UPDATE invoices SET msatoshi_received=0 WHERE state=1;" -msgstr "" - -#: wallet/db.c:193 -msgid "ALTER TABLE channels ADD COLUMN last_was_revoke INTEGER;" -msgstr "" - -#: wallet/db.c:197 wallet/db.c:490 -msgid "ALTER TABLE payments RENAME TO temp_payments;" -msgstr "" - -#: wallet/db.c:198 -msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, destination BLOB, msatoshi BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash));" -msgstr "" - -#: wallet/db.c:209 -msgid "INSERT INTO payments SELECT id, timestamp, status, payment_hash, destination, msatoshi FROM temp_payments WHERE direction=1;" -msgstr "" - -#: wallet/db.c:212 wallet/db.c:565 -msgid "DROP TABLE temp_payments;" -msgstr "" - -#: wallet/db.c:214 -msgid "ALTER TABLE payments ADD COLUMN payment_preimage BLOB;" -msgstr "" - -#: wallet/db.c:216 -msgid "ALTER TABLE payments ADD COLUMN path_secrets BLOB;" -msgstr "" - -#: wallet/db.c:219 -msgid "ALTER TABLE invoices ADD paid_timestamp BIGINT;" -msgstr "" - -#: wallet/db.c:220 -msgid "UPDATE invoices SET paid_timestamp = CURRENT_TIMESTAMP() WHERE state = 1;" -msgstr "" - -#: wallet/db.c:228 -msgid "ALTER TABLE payments ADD COLUMN route_nodes BLOB;" -msgstr "" - -#: wallet/db.c:229 -msgid "ALTER TABLE payments ADD COLUMN route_channels BLOB;" -msgstr "" - -#: wallet/db.c:230 -msgid "CREATE TABLE htlc_sigs (channelid INTEGER REFERENCES channels(id) ON DELETE CASCADE, signature BLOB);" -msgstr "" - -#: wallet/db.c:233 -msgid "CREATE INDEX channel_idx ON htlc_sigs (channelid)" -msgstr "" - -#: wallet/db.c:235 -msgid "DELETE FROM channels WHERE state=1" -msgstr "" - -#: wallet/db.c:237 -msgid "CREATE TABLE db_upgrades (upgrade_from INTEGER, lightning_version TEXT);" -msgstr "" - -#: wallet/db.c:241 wallet/db.c:431 -msgid "DELETE FROM peers WHERE id NOT IN (SELECT peer_id FROM channels);" -msgstr "" - -#: wallet/db.c:245 -msgid "UPDATE channels SET STATE = 8 WHERE state > 8;" -msgstr "" - -#: wallet/db.c:247 -msgid "ALTER TABLE invoices ADD bolt11 TEXT;" -msgstr "" - -#: wallet/db.c:251 -msgid "CREATE TABLE blocks (height INT, hash BLOB, prev_hash BLOB, UNIQUE(height));" -msgstr "" - -#: wallet/db.c:261 -msgid "ALTER TABLE outputs ADD COLUMN confirmation_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;" -msgstr "" - -#: wallet/db.c:264 -msgid "ALTER TABLE outputs ADD COLUMN spend_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;" -msgstr "" - -#: wallet/db.c:268 -msgid "CREATE INDEX output_height_idx ON outputs (confirmation_height, spend_height);" -msgstr "" - -#: wallet/db.c:271 -msgid "CREATE TABLE utxoset ( txid BLOB, outnum INT, blockheight INT REFERENCES blocks(height) ON DELETE CASCADE, spendheight INT REFERENCES blocks(height) ON DELETE SET NULL, txindex INT, scriptpubkey BLOB, satoshis BIGINT, PRIMARY KEY(txid, outnum));" -msgstr "" - -#: wallet/db.c:281 -msgid "CREATE INDEX short_channel_id ON utxoset (blockheight, txindex, outnum)" -msgstr "" - -#: wallet/db.c:286 -msgid "CREATE INDEX utxoset_spend ON utxoset (spendheight)" -msgstr "" - -#: wallet/db.c:288 -msgid "UPDATE channels SET shutdown_keyidx_local=0 WHERE shutdown_keyidx_local = -1;" -msgstr "" - -#: wallet/db.c:294 -msgid "ALTER TABLE payments ADD failonionreply BLOB;" -msgstr "" - -#: wallet/db.c:296 -msgid "ALTER TABLE payments ADD faildestperm INTEGER;" -msgstr "" - -#: wallet/db.c:298 -msgid "ALTER TABLE payments ADD failindex INTEGER;" -msgstr "" - -#: wallet/db.c:300 -msgid "ALTER TABLE payments ADD failcode INTEGER;" -msgstr "" - -#: wallet/db.c:301 -msgid "ALTER TABLE payments ADD failnode BLOB;" -msgstr "" - -#: wallet/db.c:302 -msgid "ALTER TABLE payments ADD failchannel TEXT;" -msgstr "" - -#: wallet/db.c:304 -msgid "ALTER TABLE payments ADD failupdate BLOB;" -msgstr "" - -#: wallet/db.c:308 -msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE status <> 0;" -msgstr "" - -#: wallet/db.c:315 -msgid "ALTER TABLE channels ADD in_payments_offered INTEGER DEFAULT 0;" -msgstr "" - -#: wallet/db.c:316 -msgid "ALTER TABLE channels ADD in_payments_fulfilled INTEGER DEFAULT 0;" -msgstr "" - -#: wallet/db.c:317 -msgid "ALTER TABLE channels ADD in_msatoshi_offered BIGINT DEFAULT 0;" -msgstr "" - -#: wallet/db.c:318 -msgid "ALTER TABLE channels ADD in_msatoshi_fulfilled BIGINT DEFAULT 0;" -msgstr "" - -#: wallet/db.c:319 -msgid "ALTER TABLE channels ADD out_payments_offered INTEGER DEFAULT 0;" -msgstr "" - -#: wallet/db.c:320 -msgid "ALTER TABLE channels ADD out_payments_fulfilled INTEGER DEFAULT 0;" -msgstr "" - -#: wallet/db.c:321 -msgid "ALTER TABLE channels ADD out_msatoshi_offered BIGINT DEFAULT 0;" -msgstr "" - -#: wallet/db.c:322 -msgid "ALTER TABLE channels ADD out_msatoshi_fulfilled BIGINT DEFAULT 0;" -msgstr "" - -#: wallet/db.c:323 -msgid "UPDATE channels SET in_payments_offered = 0, in_payments_fulfilled = 0 , in_msatoshi_offered = 0, in_msatoshi_fulfilled = 0 , out_payments_offered = 0, out_payments_fulfilled = 0 , out_msatoshi_offered = 0, out_msatoshi_fulfilled = 0 ;" -msgstr "" - -#: wallet/db.c:332 -msgid "ALTER TABLE payments ADD msatoshi_sent BIGINT;" -msgstr "" - -#: wallet/db.c:333 -msgid "UPDATE payments SET msatoshi_sent = msatoshi;" -msgstr "" - -#: wallet/db.c:335 -msgid "DELETE FROM utxoset WHERE blockheight IN ( SELECT DISTINCT(blockheight) FROM utxoset LEFT OUTER JOIN blocks on (blockheight = blocks.height) WHERE blocks.hash IS NULL);" -msgstr "" - -#: wallet/db.c:343 -msgid "ALTER TABLE channels ADD min_possible_feerate INTEGER;" -msgstr "" - -#: wallet/db.c:344 -msgid "ALTER TABLE channels ADD max_possible_feerate INTEGER;" -msgstr "" - -#: wallet/db.c:347 -msgid "UPDATE channels SET min_possible_feerate=0, max_possible_feerate=250000;" -msgstr "" - -#: wallet/db.c:351 -msgid "ALTER TABLE channels ADD msatoshi_to_us_min BIGINT;" -msgstr "" - -#: wallet/db.c:352 -msgid "ALTER TABLE channels ADD msatoshi_to_us_max BIGINT;" -msgstr "" - -#: wallet/db.c:353 -msgid "UPDATE channels SET msatoshi_to_us_min = msatoshi_local , msatoshi_to_us_max = msatoshi_local ;" -msgstr "" - -#: wallet/db.c:362 -msgid "CREATE TABLE transactions ( id BLOB, blockheight INTEGER REFERENCES blocks(height) ON DELETE SET NULL, txindex INTEGER, rawtx BLOB, PRIMARY KEY (id));" -msgstr "" - -#: wallet/db.c:371 -msgid "ALTER TABLE payments ADD faildetail TEXT;" -msgstr "" - -#: wallet/db.c:372 -msgid "UPDATE payments SET faildetail = 'unspecified payment failure reason' WHERE status = 2;" -msgstr "" - -#: wallet/db.c:377 -msgid "CREATE TABLE channeltxs ( id BIGSERIAL, channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, type INTEGER, transaction_id BLOB REFERENCES transactions(id) ON DELETE CASCADE, input_num INTEGER, blockheight INTEGER REFERENCES blocks(height) ON DELETE CASCADE, PRIMARY KEY(id));" -msgstr "" - -#: wallet/db.c:393 -msgid "DELETE FROM blocks WHERE height > (SELECT MIN(first_blocknum) FROM channels);" -msgstr "" - -#: wallet/db.c:399 -msgid "INSERT INTO blocks (height) VALUES ((SELECT MIN(first_blocknum) FROM channels)) ON CONFLICT(height) DO NOTHING;" -msgstr "" - -#: wallet/db.c:403 -msgid "DELETE FROM blocks WHERE height IS NULL;" -msgstr "" - -#: wallet/db.c:405 -msgid "ALTER TABLE invoices ADD description TEXT;" -msgstr "" - -#: wallet/db.c:407 -msgid "ALTER TABLE payments ADD description TEXT;" -msgstr "" - -#: wallet/db.c:409 -msgid "ALTER TABLE channels ADD future_per_commitment_point BLOB;" -msgstr "" - -#: wallet/db.c:411 -msgid "ALTER TABLE channels ADD last_sent_commit BLOB;" -msgstr "" - -#: wallet/db.c:416 -msgid "CREATE TABLE forwarded_payments ( in_htlc_id BIGINT REFERENCES channel_htlcs(id) ON DELETE SET NULL, out_htlc_id BIGINT REFERENCES channel_htlcs(id) ON DELETE SET NULL, in_channel_scid BIGINT, out_channel_scid BIGINT, in_msatoshi BIGINT, out_msatoshi BIGINT, state INTEGER, UNIQUE(in_htlc_id, out_htlc_id));" -msgstr "" - -#: wallet/db.c:428 -msgid "ALTER TABLE payments ADD faildirection INTEGER;" -msgstr "" - -#: wallet/db.c:433 -msgid "ALTER TABLE outputs ADD scriptpubkey BLOB;" -msgstr "" - -#: wallet/db.c:435 -msgid "ALTER TABLE payments ADD bolt11 TEXT;" -msgstr "" - -#: wallet/db.c:437 -msgid "ALTER TABLE channels ADD feerate_base INTEGER;" -msgstr "" - -#: wallet/db.c:438 -msgid "ALTER TABLE channels ADD feerate_ppm INTEGER;" -msgstr "" - -#: wallet/db.c:440 -msgid "ALTER TABLE channel_htlcs ADD received_time BIGINT" -msgstr "" - -#: wallet/db.c:441 -msgid "ALTER TABLE forwarded_payments ADD received_time BIGINT" -msgstr "" - -#: wallet/db.c:442 -msgid "ALTER TABLE forwarded_payments ADD resolved_time BIGINT" -msgstr "" - -#: wallet/db.c:443 -msgid "ALTER TABLE channels ADD remote_upfront_shutdown_script BLOB;" -msgstr "" - -#: wallet/db.c:446 -msgid "ALTER TABLE forwarded_payments ADD failcode INTEGER;" -msgstr "" - -#: wallet/db.c:448 -msgid "ALTER TABLE channels ADD remote_ann_node_sig BLOB;" -msgstr "" - -#: wallet/db.c:449 -msgid "ALTER TABLE channels ADD remote_ann_bitcoin_sig BLOB;" -msgstr "" - -#: wallet/db.c:451 -msgid "ALTER TABLE transactions ADD type BIGINT;" -msgstr "" - -#: wallet/db.c:456 -msgid "ALTER TABLE transactions ADD channel_id BIGINT;" -msgstr "" - -#: wallet/db.c:458 -msgid "UPDATE channels SET short_channel_id = REPLACE(short_channel_id, ':', 'x') WHERE short_channel_id IS NOT NULL;" -msgstr "" - -#: wallet/db.c:461 -msgid "UPDATE payments SET failchannel = REPLACE(failchannel, ':', 'x') WHERE failchannel IS NOT NULL;" -msgstr "" - -#: wallet/db.c:464 -msgid "ALTER TABLE channels ADD COLUMN option_static_remotekey INTEGER DEFAULT 0;" -msgstr "" - -#: wallet/db.c:466 -msgid "ALTER TABLE vars ADD COLUMN intval INTEGER" -msgstr "" - -#: wallet/db.c:467 -msgid "ALTER TABLE vars ADD COLUMN blobval BLOB" -msgstr "" - -#: wallet/db.c:468 -msgid "UPDATE vars SET intval = CAST(val AS INTEGER) WHERE name IN ('bip32_max_index', 'last_processed_block', 'next_pay_index')" -msgstr "" - -#: wallet/db.c:469 -msgid "UPDATE vars SET blobval = CAST(val AS BLOB) WHERE name = 'genesis_hash'" -msgstr "" - -#: wallet/db.c:470 -msgid "CREATE TABLE transaction_annotations ( txid BLOB, idx INTEGER, location INTEGER, type INTEGER, channel BIGINT REFERENCES channels(id), UNIQUE(txid, idx));" -msgstr "" - -#: wallet/db.c:482 -msgid "ALTER TABLE channels ADD shutdown_scriptpubkey_local BLOB;" -msgstr "" - -#: wallet/db.c:485 -msgid "UPDATE forwarded_payments SET received_time=0 WHERE received_time IS NULL;" -msgstr "" - -#: wallet/db.c:487 -msgid "ALTER TABLE invoices ADD COLUMN features BLOB DEFAULT '';" -msgstr "" - -#: wallet/db.c:491 -msgid "CREATE TABLE payments ( id BIGSERIAL, timestamp INTEGER, status INTEGER, payment_hash BLOB, destination BLOB, msatoshi BIGINT, payment_preimage BLOB, path_secrets BLOB, route_nodes BLOB, route_channels BLOB, failonionreply BLOB, faildestperm INTEGER, failindex INTEGER, failcode INTEGER, failnode BLOB, failchannel TEXT, failupdate BLOB, msatoshi_sent BIGINT, faildetail TEXT, description TEXT, faildirection INTEGER, bolt11 TEXT, total_msat BIGINT, partid BIGINT, PRIMARY KEY (id), UNIQUE (payment_hash, partid))" -msgstr "" - -#: wallet/db.c:518 -msgid "INSERT INTO payments (id, timestamp, status, payment_hash, destination, msatoshi, payment_preimage, path_secrets, route_nodes, route_channels, failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, msatoshi_sent, faildetail, description, faildirection, bolt11)SELECT id, timestamp, status, payment_hash, destination, msatoshi, payment_preimage, path_secrets, route_nodes, route_channels, failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, msatoshi_sent, faildetail, description, faildirection, bolt11 FROM temp_payments;" -msgstr "" - -#: wallet/db.c:563 -msgid "UPDATE payments SET total_msat = msatoshi;" -msgstr "" - -#: wallet/db.c:564 -msgid "UPDATE payments SET partid = 0;" -msgstr "" - -#: wallet/db.c:566 -msgid "ALTER TABLE channel_htlcs ADD partid BIGINT;" -msgstr "" - -#: wallet/db.c:567 -msgid "UPDATE channel_htlcs SET partid = 0;" -msgstr "" - -#: wallet/db.c:568 -msgid "CREATE TABLE channel_feerates ( channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, hstate INTEGER, feerate_per_kw INTEGER, UNIQUE (channel_id, hstate));" -msgstr "" - -#: wallet/db.c:579 -msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 4, local_feerate_per_kw FROM channels WHERE funder = 0;" -msgstr "" - -#: wallet/db.c:583 -msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 1, remote_feerate_per_kw FROM channels WHERE funder = 0 and local_feerate_per_kw != remote_feerate_per_kw;" -msgstr "" - -#: wallet/db.c:588 -msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 14, remote_feerate_per_kw FROM channels WHERE funder = 1;" -msgstr "" - -#: wallet/db.c:592 -msgid "INSERT INTO channel_feerates(channel_id, hstate, feerate_per_kw) SELECT id, 11, local_feerate_per_kw FROM channels WHERE funder = 1 and local_feerate_per_kw != remote_feerate_per_kw;" -msgstr "" - -#: wallet/db.c:596 -msgid "INSERT INTO vars (name, intval) VALUES ('data_version', 0);" -msgstr "" - -#: wallet/db.c:599 -msgid "ALTER TABLE channel_htlcs ADD localfailmsg BLOB;" -msgstr "" - -#: wallet/db.c:600 -msgid "UPDATE channel_htlcs SET localfailmsg=decode('2002', 'hex') WHERE malformed_onion != 0 AND direction = 1;" -msgstr "" - -#: wallet/db.c:601 -msgid "ALTER TABLE channels ADD our_funding_satoshi BIGINT DEFAULT 0;" -msgstr "" - -#: wallet/db.c:602 -msgid "CREATE TABLE penalty_bases ( channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, commitnum BIGINT, txid BLOB, outnum INTEGER, amount BIGINT, PRIMARY KEY (channel_id, commitnum));" -msgstr "" - -#: wallet/db.c:612 -msgid "ALTER TABLE channel_htlcs ADD we_filled INTEGER;" -msgstr "" - -#: wallet/db.c:614 -msgid "INSERT INTO vars (name, intval) VALUES ('coin_moves_count', 0);" -msgstr "" - -#: wallet/db.c:841 -msgid "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?" -msgstr "" - -#: wallet/db.c:941 -msgid "SELECT version FROM version LIMIT 1" -msgstr "" - -#: wallet/db.c:998 -msgid "UPDATE version SET version=?;" -msgstr "" - -#: wallet/db.c:1006 -msgid "INSERT INTO db_upgrades VALUES (?, ?);" -msgstr "" - -#: wallet/db.c:1018 -msgid "SELECT intval FROM vars WHERE name = 'data_version'" -msgstr "" - -#: wallet/db.c:1044 -msgid "SELECT intval FROM vars WHERE name= ? LIMIT 1" -msgstr "" - -#: wallet/db.c:1060 -msgid "UPDATE vars SET intval=? WHERE name=?;" -msgstr "" - -#: wallet/db.c:1069 -msgid "INSERT INTO vars (name, intval) VALUES (?, ?);" -msgstr "" - -#: wallet/db.c:1082 -msgid "UPDATE channels SET feerate_base = ?, feerate_ppm = ?;" -msgstr "" - -#: wallet/db.c:1102 -msgid "UPDATE channels SET our_funding_satoshi = funding_satoshi WHERE funder = 0;" -msgstr "" - -#: wallet/invoices.c:129 -msgid "UPDATE invoices SET state = ? WHERE state = ? AND expiry_time <= ?;" -msgstr "" - -#: wallet/invoices.c:177 -msgid "SELECT id FROM invoices WHERE state = ? AND expiry_time <= ?" -msgstr "" - -#: wallet/invoices.c:216 -msgid "SELECT MIN(expiry_time) FROM invoices WHERE state = ?;" -msgstr "" - -#: wallet/invoices.c:282 -msgid "INSERT INTO invoices ( payment_hash, payment_key, state , msatoshi, label, expiry_time , pay_index, msatoshi_received , paid_timestamp, bolt11, description, features) VALUES ( ?, ?, ? , ?, ?, ? , NULL, NULL , NULL, ?, ?, ?);" -msgstr "" - -#: wallet/invoices.c:330 -msgid "SELECT id FROM invoices WHERE label = ?;" -msgstr "" - -#: wallet/invoices.c:352 -msgid "SELECT id FROM invoices WHERE payment_hash = ?;" -msgstr "" - -#: wallet/invoices.c:373 -msgid "SELECT id FROM invoices WHERE payment_hash = ? AND state = ?;" -msgstr "" - -#: wallet/invoices.c:397 -msgid "DELETE FROM invoices WHERE id=?;" -msgstr "" - -#: wallet/invoices.c:417 -msgid "DELETE FROM invoices WHERE state = ? AND expiry_time <= ?;" -msgstr "" - -#: wallet/invoices.c:431 -msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices;" -msgstr "" - -#: wallet/invoices.c:487 -msgid "SELECT state FROM invoices WHERE id = ?;" -msgstr "" - -#: wallet/invoices.c:514 -msgid "UPDATE invoices SET state=? , pay_index=? , msatoshi_received=? , paid_timestamp=? WHERE id=?;" -msgstr "" - -#: wallet/invoices.c:570 -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:619 -msgid "SELECT state, payment_key, payment_hash, label, msatoshi, expiry_time, pay_index, msatoshi_received, paid_timestamp, bolt11, description, features FROM invoices WHERE id = ?;" -msgstr "" - -#: wallet/wallet.c:46 -msgid "SELECT txid, outnum FROM utxoset WHERE spendheight is NULL" -msgstr "" - -#: wallet/wallet.c:81 -msgid "SELECT * from outputs WHERE prev_out_tx=? AND prev_out_index=?" -msgstr "" - -#: wallet/wallet.c:95 -msgid "INSERT INTO outputs ( prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:211 -msgid "UPDATE outputs SET status=? WHERE status=? AND prev_out_tx=? AND prev_out_index=?" -msgstr "" - -#: wallet/wallet.c:219 -msgid "UPDATE outputs SET status=? WHERE prev_out_tx=? AND prev_out_index=?" -msgstr "" - -#: wallet/wallet.c:238 -msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey FROM outputs" -msgstr "" - -#: wallet/wallet.c:253 -msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey FROM outputs WHERE status= ? " -msgstr "" - -#: wallet/wallet.c:289 -msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey FROM outputs WHERE channel_id IS NOT NULL AND confirmation_height IS NULL" -msgstr "" - -#: wallet/wallet.c:324 -msgid "SELECT prev_out_tx, prev_out_index, value, type, status, keyindex, channel_id, peer_id, commitment_point, confirmation_height, spend_height, scriptpubkey FROM outputs WHERE prev_out_tx = ? AND prev_out_index = ?" -msgstr "" - -#: wallet/wallet.c:663 -msgid "INSERT INTO shachains (min_index, num_valid) VALUES (?, 0);" -msgstr "" - -#: wallet/wallet.c:707 -msgid "UPDATE shachains SET num_valid=?, min_index=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:714 -msgid "UPDATE shachain_known SET idx=?, hash=? WHERE shachain_id=? AND pos=?" -msgstr "" - -#: wallet/wallet.c:726 -msgid "INSERT INTO shachain_known (shachain_id, pos, idx, hash) VALUES (?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:748 -msgid "SELECT min_index, num_valid FROM shachains WHERE id=?" -msgstr "" - -#: wallet/wallet.c:763 -msgid "SELECT idx, hash, pos FROM shachain_known WHERE shachain_id=?" -msgstr "" - -#: wallet/wallet.c:786 -msgid "SELECT id, node_id, address FROM peers WHERE id=?;" -msgstr "" - -#: wallet/wallet.c:815 -msgid "SELECT signature FROM htlc_sigs WHERE channelid = ?" -msgstr "" - -#: wallet/wallet.c:839 -msgid "SELECT remote_ann_node_sig, remote_ann_bitcoin_sig FROM channels WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:883 -msgid "SELECT hstate, feerate_per_kw FROM channel_feerates WHERE channel_id = ?" -msgstr "" - -#: wallet/wallet.c:1085 -msgid "SELECT id FROM channels ORDER BY id DESC LIMIT 1;" -msgstr "" - -#: wallet/wallet.c:1102 -msgid "SELECT id, peer_id, short_channel_id, channel_config_local, channel_config_remote, state, funder, channel_flags, minimum_depth, next_index_local, next_index_remote, next_htlc_id, funding_tx_id, funding_tx_outnum, funding_satoshi, our_funding_satoshi, funding_locked_remote, push_msatoshi, msatoshi_local, fundingkey_remote, revocation_basepoint_remote, payment_basepoint_remote, htlc_basepoint_remote, delayed_payment_basepoint_remote, per_commit_remote, old_per_commit_remote, local_feerate_per_kw, remote_feerate_per_kw, shachain_remote_id, shutdown_scriptpubkey_remote, shutdown_keyidx_local, last_sent_commit_state, last_sent_commit_id, last_tx, last_sig, last_was_revoke, first_blocknum, min_possible_feerate, max_possible_feerate, msatoshi_to_us_min, msatoshi_to_us_max, future_per_commitment_point, last_sent_commit, feerate_base, feerate_ppm, remote_upfront_shutdown_script, option_static_remotekey, shutdown_scriptpubkey_local FROM channels WHERE state < ?;" -msgstr "" - -#: wallet/wallet.c:1189 -msgid "UPDATE channels SET in_payments_offered = COALESCE(in_payments_offered, 0) + 1 , in_msatoshi_offered = COALESCE(in_msatoshi_offered, 0) + ? WHERE id = ?;" -msgstr "" - -#: wallet/wallet.c:1194 -msgid "UPDATE channels SET in_payments_fulfilled = COALESCE(in_payments_fulfilled, 0) + 1 , in_msatoshi_fulfilled = COALESCE(in_msatoshi_fulfilled, 0) + ? WHERE id = ?;" -msgstr "" - -#: wallet/wallet.c:1199 -msgid "UPDATE channels SET out_payments_offered = COALESCE(out_payments_offered, 0) + 1 , out_msatoshi_offered = COALESCE(out_msatoshi_offered, 0) + ? WHERE id = ?;" -msgstr "" - -#: wallet/wallet.c:1204 -msgid "UPDATE channels SET out_payments_fulfilled = COALESCE(out_payments_fulfilled, 0) + 1 , out_msatoshi_fulfilled = COALESCE(out_msatoshi_fulfilled, 0) + ? WHERE id = ?;" -msgstr "" - -#: wallet/wallet.c:1246 -msgid "SELECT in_payments_offered, in_payments_fulfilled, in_msatoshi_offered, in_msatoshi_fulfilled, out_payments_offered, out_payments_fulfilled, out_msatoshi_offered, out_msatoshi_fulfilled FROM channels WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:1275 -msgid "SELECT MIN(height), MAX(height) FROM blocks;" -msgstr "" - -#: wallet/wallet.c:1297 -msgid "INSERT INTO channel_configs DEFAULT VALUES;" -msgstr "" - -#: wallet/wallet.c:1309 -msgid "UPDATE channel_configs SET dust_limit_satoshis=?, max_htlc_value_in_flight_msat=?, channel_reserve_satoshis=?, htlc_minimum_msat=?, to_self_delay=?, max_accepted_htlcs=? WHERE id=?;" -msgstr "" - -#: wallet/wallet.c:1333 -msgid "SELECT id, dust_limit_satoshis, max_htlc_value_in_flight_msat, channel_reserve_satoshis, htlc_minimum_msat, to_self_delay, max_accepted_htlcs FROM channel_configs WHERE id= ? ;" -msgstr "" - -#: wallet/wallet.c:1367 -msgid "UPDATE channels SET remote_ann_node_sig=?, remote_ann_bitcoin_sig=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:1386 -msgid "UPDATE channels SET shachain_remote_id=?, short_channel_id=?, state=?, funder=?, channel_flags=?, minimum_depth=?, next_index_local=?, next_index_remote=?, next_htlc_id=?, funding_tx_id=?, funding_tx_outnum=?, funding_satoshi=?, our_funding_satoshi=?, funding_locked_remote=?, push_msatoshi=?, msatoshi_local=?, shutdown_scriptpubkey_remote=?, shutdown_keyidx_local=?, channel_config_local=?, last_tx=?, last_sig=?, last_was_revoke=?, min_possible_feerate=?, max_possible_feerate=?, msatoshi_to_us_min=?, msatoshi_to_us_max=?, feerate_base=?, feerate_ppm=?, remote_upfront_shutdown_script=?, option_static_remotekey=?, shutdown_scriptpubkey_local=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:1472 -msgid "UPDATE channels SET fundingkey_remote=?, revocation_basepoint_remote=?, payment_basepoint_remote=?, htlc_basepoint_remote=?, delayed_payment_basepoint_remote=?, per_commit_remote=?, old_per_commit_remote=?, channel_config_remote=?, future_per_commitment_point=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:1499 -msgid "DELETE FROM channel_feerates WHERE channel_id=?" -msgstr "" - -#: wallet/wallet.c:1509 -msgid "INSERT INTO channel_feerates VALUES(?, ?, ?)" -msgstr "" - -#: wallet/wallet.c:1523 -msgid "UPDATE channels SET last_sent_commit=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:1543 -msgid "INSERT INTO peers (node_id, address) VALUES (?, ?);" -msgstr "" - -#: wallet/wallet.c:1555 -msgid "INSERT INTO channels (peer_id, first_blocknum, id) VALUES (?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:1581 -msgid "DELETE FROM channel_htlcs WHERE channel_id=?" -msgstr "" - -#: wallet/wallet.c:1587 -msgid "DELETE FROM htlc_sigs WHERE channelid=?" -msgstr "" - -#: wallet/wallet.c:1593 -msgid "DELETE FROM channeltxs WHERE channel_id=?" -msgstr "" - -#: wallet/wallet.c:1599 -msgid "DELETE FROM shachains WHERE id IN ( SELECT shachain_remote_id FROM channels WHERE channels.id=?)" -msgstr "" - -#: wallet/wallet.c:1609 -msgid "UPDATE channels SET state=?, peer_id=?WHERE channels.id=?" -msgstr "" - -#: wallet/wallet.c:1623 -msgid "SELECT * FROM channels WHERE peer_id = ?;" -msgstr "" - -#: wallet/wallet.c:1631 -msgid "DELETE FROM peers WHERE id=?" -msgstr "" - -#: wallet/wallet.c:1642 -msgid "UPDATE outputs SET confirmation_height = ? WHERE prev_out_tx = ?" -msgstr "" - -#: wallet/wallet.c:1743 -msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, shared_secret, routing_onion, received_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:1796 -msgid "INSERT INTO channel_htlcs ( channel_id, channel_htlc_id, direction, origin_htlc, msatoshi, cltv_expiry, payment_hash, payment_key, hstate, routing_onion, partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:1856 -msgid "UPDATE channel_htlcs SET hstate=?, payment_key=?, malformed_onion=?, failuremsg=?, localfailmsg=?, we_filled=? WHERE id=?" -msgstr "" - -#: wallet/wallet.c:2075 -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, we_filled FROM channel_htlcs WHERE direction= ? AND channel_id= ? AND hstate != ?" -msgstr "" - -#: wallet/wallet.c:2122 -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:2252 -msgid "SELECT channel_id, direction, cltv_expiry, channel_htlc_id, payment_hash FROM channel_htlcs WHERE channel_id = ?;" -msgstr "" - -#: wallet/wallet.c:2286 -msgid "DELETE FROM channel_htlcs WHERE direction = ? AND origin_htlc = ? AND payment_hash = ? AND partid = ?;" -msgstr "" - -#: wallet/wallet.c:2339 -msgid "SELECT status FROM payments WHERE payment_hash=? AND partid = ?;" -msgstr "" - -#: wallet/wallet.c:2357 -msgid "INSERT INTO payments ( status, payment_hash, destination, msatoshi, timestamp, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, total_msat, partid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:2440 -msgid "DELETE FROM payments WHERE payment_hash = ? AND partid = ?" -msgstr "" - -#: wallet/wallet.c:2530 -msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments WHERE payment_hash = ? AND partid = ?" -msgstr "" - -#: wallet/wallet.c:2579 -msgid "UPDATE payments SET status=? WHERE payment_hash=? AND partid=?" -msgstr "" - -#: wallet/wallet.c:2589 -msgid "UPDATE payments SET payment_preimage=? WHERE payment_hash=? AND partid=?" -msgstr "" - -#: wallet/wallet.c:2599 -msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE payment_hash = ? AND partid = ?;" -msgstr "" - -#: wallet/wallet.c:2631 -msgid "SELECT failonionreply, faildestperm, failindex, failcode, failnode, failchannel, failupdate, faildetail, faildirection FROM payments WHERE payment_hash=? AND partid=?;" -msgstr "" - -#: wallet/wallet.c:2698 -msgid "UPDATE payments SET failonionreply=? , faildestperm=? , failindex=? , failcode=? , failnode=? , failchannel=? , failupdate=? , faildetail=? , faildirection=? WHERE payment_hash=? AND partid=?;" -msgstr "" - -#: wallet/wallet.c:2762 -msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments WHERE payment_hash = ?;" -msgstr "" - -#: wallet/wallet.c:2783 -msgid "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid FROM payments;" -msgstr "" - -#: wallet/wallet.c:2826 -msgid "DELETE FROM htlc_sigs WHERE channelid = ?" -msgstr "" - -#: wallet/wallet.c:2833 -msgid "INSERT INTO htlc_sigs (channelid, signature) VALUES (?, ?)" -msgstr "" - -#: wallet/wallet.c:2845 -msgid "SELECT blobval FROM vars WHERE name='genesis_hash'" -msgstr "" - -#: wallet/wallet.c:2869 -msgid "INSERT INTO vars (name, blobval) VALUES ('genesis_hash', ?);" -msgstr "" - -#: wallet/wallet.c:2887 -msgid "SELECT txid, outnum FROM utxoset WHERE spendheight < ?" -msgstr "" - -#: wallet/wallet.c:2899 -msgid "DELETE FROM utxoset WHERE spendheight < ?" -msgstr "" - -#: wallet/wallet.c:2907 wallet/wallet.c:3051 -msgid "INSERT INTO blocks (height, hash, prev_hash) VALUES (?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:2926 -msgid "DELETE FROM blocks WHERE hash = ?" -msgstr "" - -#: wallet/wallet.c:2932 -msgid "SELECT * FROM blocks WHERE height >= ?;" -msgstr "" - -#: wallet/wallet.c:2941 -msgid "DELETE FROM blocks WHERE height > ?" -msgstr "" - -#: wallet/wallet.c:2957 -msgid "UPDATE outputs SET spend_height = ? WHERE prev_out_tx = ? AND prev_out_index = ?" -msgstr "" - -#: wallet/wallet.c:2973 -msgid "UPDATE utxoset SET spendheight = ? WHERE txid = ? AND outnum = ?" -msgstr "" - -#: wallet/wallet.c:2992 -msgid "SELECT blockheight, txindex FROM utxoset WHERE txid = ? AND outnum = ?" -msgstr "" - -#: wallet/wallet.c:3024 wallet/wallet.c:3062 -msgid "INSERT INTO utxoset ( txid, outnum, blockheight, spendheight, txindex, scriptpubkey, satoshis) VALUES(?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3089 -msgid "SELECT height FROM blocks WHERE height = ?" -msgstr "" - -#: wallet/wallet.c:3102 -msgid "SELECT txid, spendheight, scriptpubkey, satoshis FROM utxoset WHERE blockheight = ? AND txindex = ? AND outnum = ? AND spendheight IS NULL" -msgstr "" - -#: wallet/wallet.c:3144 wallet/wallet.c:3304 -msgid "SELECT blockheight FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3154 -msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3175 -msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:3192 -msgid "INSERT INTO transaction_annotations (txid, idx, location, type, channel) VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;" -msgstr "" - -#: wallet/wallet.c:3224 -msgid "SELECT type, channel_id FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3240 -msgid "UPDATE transactions SET type = ?, channel_id = ? WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:3259 -msgid "SELECT type FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3282 -msgid "SELECT rawtx FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3328 -msgid "SELECT blockheight, txindex FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3356 -msgid "SELECT id FROM transactions WHERE blockheight=?" -msgstr "" - -#: wallet/wallet.c:3375 -msgid "INSERT INTO channeltxs ( channel_id, type, transaction_id, input_num, blockheight) VALUES (?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3399 -msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;" -msgstr "" - -#: wallet/wallet.c:3420 -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:3465 -msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?" -msgstr "" - -#: wallet/wallet.c:3523 -msgid "INSERT INTO forwarded_payments ( in_htlc_id, out_htlc_id, in_channel_scid, out_channel_scid, in_msatoshi, out_msatoshi, state, received_time, resolved_time, failcode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3582 -msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;" -msgstr "" - -#: wallet/wallet.c:3606 -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:3769 -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" -msgstr "" - -#: wallet/wallet.c:3863 -msgid "INSERT INTO penalty_bases ( channel_id, commitnum, txid, outnum, amount) VALUES (?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3888 -msgid "SELECT commitnum, txid, outnum, amount FROM penalty_bases WHERE channel_id = ?" -msgstr "" - -#: wallet/wallet.c:3912 -msgid "DELETE FROM penalty_bases WHERE channel_id = ? AND commitnum = ?" -msgstr "" - -#: wallet/test/run-db.c:101 -msgid "SELECT name FROM sqlite_master WHERE type='table';" -msgstr "" - -#: wallet/test/run-db.c:106 -msgid "not a valid SQL statement" -msgstr "" - -#: wallet/test/run-wallet.c:1315 -msgid "INSERT INTO channels (id) VALUES (1);" -msgstr "" diff --git a/wallet/statements_gettextgen.po b/wallet/statements_gettextgen.po index 061c914a2..1f2984689 100644 --- a/wallet/statements_gettextgen.po +++ b/wallet/statements_gettextgen.po @@ -590,67 +590,87 @@ msgstr "" msgid "CREATE TABLE channel_funding_inflights ( channel_id BIGSERIAL REFERENCES channels(id) ON DELETE CASCADE, funding_tx_id BLOB, funding_tx_outnum INTEGER, funding_feerate INTEGER, funding_satoshi BIGINT, our_funding_satoshi BIGINT, funding_psbt BLOB, last_tx BLOB, last_sig BLOB, funding_tx_remote_sigs_received INTEGER, PRIMARY KEY (channel_id, funding_tx_id));" msgstr "" -#: wallet/db.c:919 +#: wallet/db.c:693 +msgid "ALTER TABLE channels ADD revocation_basepoint_local BLOB" +msgstr "" + +#: wallet/db.c:694 +msgid "ALTER TABLE channels ADD payment_basepoint_local BLOB" +msgstr "" + +#: wallet/db.c:695 +msgid "ALTER TABLE channels ADD htlc_basepoint_local BLOB" +msgstr "" + +#: wallet/db.c:696 +msgid "ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB" +msgstr "" + +#: wallet/db.c:697 +msgid "ALTER TABLE channels ADD funding_pubkey_local BLOB" +msgstr "" + +#: wallet/db.c:924 msgid "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?" msgstr "" -#: wallet/db.c:1019 +#: wallet/db.c:1024 msgid "SELECT version FROM version LIMIT 1" msgstr "" -#: wallet/db.c:1077 +#: wallet/db.c:1082 msgid "UPDATE version SET version=?;" msgstr "" -#: wallet/db.c:1085 +#: wallet/db.c:1090 msgid "INSERT INTO db_upgrades VALUES (?, ?);" msgstr "" -#: wallet/db.c:1097 +#: wallet/db.c:1102 msgid "SELECT intval FROM vars WHERE name = 'data_version'" msgstr "" -#: wallet/db.c:1124 +#: wallet/db.c:1129 msgid "SELECT intval FROM vars WHERE name= ? LIMIT 1" msgstr "" -#: wallet/db.c:1140 +#: wallet/db.c:1145 msgid "UPDATE vars SET intval=? WHERE name=?;" msgstr "" -#: wallet/db.c:1149 +#: wallet/db.c:1154 msgid "INSERT INTO vars (name, intval) VALUES (?, ?);" msgstr "" -#: wallet/db.c:1163 +#: wallet/db.c:1168 msgid "UPDATE channels SET feerate_base = ?, feerate_ppm = ?;" msgstr "" -#: wallet/db.c:1184 +#: wallet/db.c:1189 msgid "UPDATE channels SET our_funding_satoshi = funding_satoshi WHERE funder = 0;" msgstr "" -#: wallet/db.c:1200 +#: wallet/db.c:1205 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:1262 +#: wallet/db.c:1267 msgid "UPDATE outputs SET scriptpubkey = ? WHERE prev_out_tx = ? AND prev_out_index = ?" msgstr "" -#: wallet/db.c:1287 +#: wallet/db.c:1292 msgid "SELECT id, funding_tx_id, funding_tx_outnum FROM channels;" msgstr "" -#: wallet/db.c:1306 +#: wallet/db.c:1311 msgid "UPDATE channels SET full_channel_id = ? WHERE id = ?;" msgstr "" -#: wallet/db.c:1329 +#: wallet/db.c:1334 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:1396 +#: wallet/db.c:1401 msgid "UPDATE channels SET last_tx = ? WHERE id = ?;" msgstr "" @@ -1209,4 +1229,4 @@ msgstr "" #: wallet/test/run-wallet.c:1616 msgid "INSERT INTO channels (id) VALUES (1);" msgstr "" -# SHA256STAMP:4fb460b69d30a052f367c585ebefaefb8e032d2a6bf591ec48ae3117ccbb2966 +# SHA256STAMP:1e757793031663e303889a7aa483262adf1078d9fc48ce6f0a7fef08cd4a12f7