diff --git a/doc/lightning-listsendpays.7 b/doc/lightning-listsendpays.7 index 5a96008cb94a..ac0e30eebfa1 100644 --- a/doc/lightning-listsendpays.7 +++ b/doc/lightning-listsendpays.7 @@ -3,14 +3,14 @@ lightning-listsendpays - Low-level command for querying sendpay status .SH SYNOPSIS -\fBlistsendpays\fR [\fIbolt11\fR] [\fIpayment_hash\fR] [*status*] +\fBlistsendpays\fR [\fIbolt11\fR] [\fIpayment_hash\fR] [\fIstatus\fR] .SH DESCRIPTION The \fBlistsendpays\fR RPC command gets the status of all \fIsendpay\fR commands (which is also used by the \fIpay\fR command), or with \fIbolt11\fR or \fIpayment_hash\fR limits results to that specific payment\. You cannot -specify both\. It is possible filter the payments also by status\. +specify both\. It is possible filter the payments also by \fIstatus\fR\. Note that in future there may be more than one concurrent \fIsendpay\fR @@ -75,4 +75,4 @@ responsible\. Main web site: \fIhttps://github.com/ElementsProject/lightning\fR -\" SHA256STAMP:b764944a2853635154668dbcc89addb2ce87a476821e23d2841b6da5ba7943f3 +\" SHA256STAMP:434378df97caee4272db4a11fc43a5e082af8c492f5fbc953add49c418c6872e diff --git a/doc/lightning-listsendpays.7.md b/doc/lightning-listsendpays.7.md index 5d4229cd6225..804d55e31c88 100644 --- a/doc/lightning-listsendpays.7.md +++ b/doc/lightning-listsendpays.7.md @@ -4,7 +4,7 @@ lightning-listsendpays -- Low-level command for querying sendpay status SYNOPSIS -------- -**listsendpays** \[*bolt11*\] \[*payment\_hash*\] [\*status*\] +**listsendpays** \[*bolt11*\] \[*payment\_hash*\] \[*status*\] DESCRIPTION ----------- @@ -12,7 +12,7 @@ DESCRIPTION The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment\_hash* limits results to that specific payment. You cannot -specify both. It is possible filter the payments also by status. +specify both. It is possible filter the payments also by *status*. Note that in future there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution. diff --git a/external/lnprototest b/external/lnprototest index 9beb1677d615..4e8d0b71f80b 160000 --- a/external/lnprototest +++ b/external/lnprototest @@ -1 +1 @@ -Subproject commit 9beb1677d61534a34a4ab365cb79b84376b549fc +Subproject commit 4e8d0b71f80b5049396d5c43b203406aaebb0b07 diff --git a/wallet/db.c b/wallet/db.c index 3bfb7a9335a3..254d73e18e89 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -1697,7 +1697,7 @@ void db_bind_preimage(struct db_stmt *stmt, int pos, const struct preimage *p) void db_bind_sha256(struct db_stmt *stmt, int pos, const struct sha256 *s) { - db_bind_blob(stmt, pos, s->u.u8, sizeof(struct sha256)); + db_bind_blob(stmt, pos, s->u.u8, sizeof(struct sha256)); } void db_bind_sha256d(struct db_stmt *stmt, int pos, const struct sha256_double *s) diff --git a/wallet/db_postgres_sqlgen.c b/wallet/db_postgres_sqlgen.c index 10777caa2505..8749ff129d50 100644 --- a/wallet/db_postgres_sqlgen.c +++ b/wallet/db_postgres_sqlgen.c @@ -1725,27 +1725,9 @@ struct db_query db_postgres_queries[] = { .readonly = false, }, { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? AND status = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = $1 AND status = $2 ORDER BY id;", - .placeholders = 2, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = $1 ORDER BY id;", - .placeholders = 1, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE status = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE status = $1 ORDER BY id;", - .placeholders = 1, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments ORDER BY id;", - .placeholders = 0, + .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE (payment_hash = ? OR ?) AND (status = ? OR ?) ORDER BY id;", + .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE (payment_hash = $1 OR $2) AND (status = $3 OR $4) ORDER BY id;", + .placeholders = 4, .readonly = true, }, { @@ -2080,138 +2062,10 @@ struct db_query db_postgres_queries[] = { }, }; -#define DB_POSTGRES_QUERY_COUNT 345 +#define DB_POSTGRES_QUERY_COUNT 342 #endif /* HAVE_POSTGRES */ #endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */ -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:a70af01d3b2f3a7003703b7feb0b2ef12359e0d2850bde1697a53780e2f5dbae -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -======= ->>>>>>> plugin: Adding status to the pay plugin -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:f929ee6db13bdf55b5e0cdf54840091948b664a61c63a4aaaef403dc7e6f23ad -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:219fccaaf2391eeabadd4cc15b4a3431c7ecab9d17755582e6962a34c74982c5 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:1808964024bcccbd2787e723881f263b1a77ea33c302ac2b6d61dae20486a7e4 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:411593f0957475d832c02cd75a8b0eed30b00fc6178797262ae7dd697de22383 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:be7e5cedcb61a9b96566d4531bb25f2db4e5a344b0d884eec3fc3adf7a4fe242 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:df06b800543e6bb886100ca428247ac1097f749098779dae43ba875154700f58 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:27a166e040e517422e91cf7ffbd12426b34337b8d75f82d7aa4c448beae5e821 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:6353b67b3e4f539da2d1f0c2564c4a8243f07d59cd0b73bc83d5552600bd67f7 -======= -// SHA256STAMP:b5f4c156aa7e336af86f98eafc5e198d3653ff27b21d861a5e777645bf6d89ec ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -======= -======= -======= -======= -======= -======= -======= -======= -======= -// SHA256STAMP:2af9ace16d4db060e649c3e078271504fce5a7c5661a25464a551aa7cc7029d0 ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= -======= -======= -======= -======= -======= -======= -======= -// SHA256STAMP:c08699eae7d8de418f7b197aad5682203ebbae633ce8888b9b4797a2db8ce106 ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> doc: Update doc with the new parameter supported -======= -======= -// SHA256STAMP:d6c1c3aced24e67abe2596259beb7599406c070622ef70f88f07d2672c4f4eb9 ->>>>>>> plugin: Adding status to the pay plugin ->>>>>>> plugin: Adding status to the pay plugin +// SHA256STAMP:8bc1b41b77977755740a6d292705cc757502aa7c969598d036957d802569580e diff --git a/wallet/db_sqlite3_sqlgen.c b/wallet/db_sqlite3_sqlgen.c index 258788991384..938817962060 100644 --- a/wallet/db_sqlite3_sqlgen.c +++ b/wallet/db_sqlite3_sqlgen.c @@ -1725,27 +1725,9 @@ struct db_query db_sqlite3_queries[] = { .readonly = false, }, { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? AND status = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? AND status = ? ORDER BY id;", - .placeholders = 2, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;", - .placeholders = 1, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE status = ? ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE status = ? ORDER BY id;", - .placeholders = 1, - .readonly = true, - }, - { - .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments ORDER BY id;", - .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments ORDER BY id;", - .placeholders = 0, + .name = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE (payment_hash = ? OR ?) AND (status = ? OR ?) ORDER BY id;", + .query = "SELECT id, status, destination, msatoshi, payment_hash, timestamp, payment_preimage, path_secrets, route_nodes, route_channels, msatoshi_sent, description, bolt11, failonionreply, total_msat, partid, local_offer_id FROM payments WHERE (payment_hash = ? OR ?) AND (status = ? OR ?) ORDER BY id;", + .placeholders = 4, .readonly = true, }, { @@ -2080,138 +2062,10 @@ struct db_query db_sqlite3_queries[] = { }, }; -#define DB_SQLITE3_QUERY_COUNT 345 +#define DB_SQLITE3_QUERY_COUNT 342 #endif /* HAVE_SQLITE3 */ #endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */ -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:a70af01d3b2f3a7003703b7feb0b2ef12359e0d2850bde1697a53780e2f5dbae -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -======= ->>>>>>> plugin: Adding status to the pay plugin -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:f929ee6db13bdf55b5e0cdf54840091948b664a61c63a4aaaef403dc7e6f23ad -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:219fccaaf2391eeabadd4cc15b4a3431c7ecab9d17755582e6962a34c74982c5 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:1808964024bcccbd2787e723881f263b1a77ea33c302ac2b6d61dae20486a7e4 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:411593f0957475d832c02cd75a8b0eed30b00fc6178797262ae7dd697de22383 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:be7e5cedcb61a9b96566d4531bb25f2db4e5a344b0d884eec3fc3adf7a4fe242 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:df06b800543e6bb886100ca428247ac1097f749098779dae43ba875154700f58 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:27a166e040e517422e91cf7ffbd12426b34337b8d75f82d7aa4c448beae5e821 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master -// SHA256STAMP:6353b67b3e4f539da2d1f0c2564c4a8243f07d59cd0b73bc83d5552600bd67f7 -======= -// SHA256STAMP:b5f4c156aa7e336af86f98eafc5e198d3653ff27b21d861a5e777645bf6d89ec ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -======= -======= -======= -======= -======= -======= -======= -======= -======= -// SHA256STAMP:2af9ace16d4db060e649c3e078271504fce5a7c5661a25464a551aa7cc7029d0 ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= -======= -======= -======= -======= -======= -======= -======= -// SHA256STAMP:c08699eae7d8de418f7b197aad5682203ebbae633ce8888b9b4797a2db8ce106 ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> doc: Update doc with the new parameter supported -======= -======= -// SHA256STAMP:d6c1c3aced24e67abe2596259beb7599406c070622ef70f88f07d2672c4f4eb9 ->>>>>>> plugin: Adding status to the pay plugin ->>>>>>> plugin: Adding status to the pay plugin +// SHA256STAMP:8bc1b41b77977755740a6d292705cc757502aa7c969598d036957d802569580e diff --git a/wallet/statements_gettextgen.po b/wallet/statements_gettextgen.po index 245259518d79..778a4c4a361a 100644 --- a/wallet/statements_gettextgen.po +++ b/wallet/statements_gettextgen.po @@ -1142,519 +1142,211 @@ msgstr "" msgid "UPDATE payments SET failonionreply=? , faildestperm=? , failindex=? , failcode=? , failnode=? , failchannel=? , failupdate=? , faildetail=? , faildirection=? WHERE payment_hash=? AND partid=?;" msgstr "" -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3355 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3347 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3346 ->>>>>>> rpc: Integrate the status flow in the listsendpays command ->>>>>>> rpc: Integrate the status flow in the listsendpays command -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, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3378 -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, local_offer_id FROM payments ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3429 -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, local_offer_id FROM payments WHERE local_offer_id = ?;" -msgstr "" - -#: wallet/wallet.c:3474 -msgid "DELETE FROM htlc_sigs WHERE channelid = ?" -msgstr "" - -#: wallet/wallet.c:3481 -msgid "INSERT INTO htlc_sigs (channelid, signature) VALUES (?, ?)" -msgstr "" - -#: wallet/wallet.c:3493 -msgid "SELECT blobval FROM vars WHERE name='genesis_hash'" -msgstr "" - -#: wallet/wallet.c:3517 -msgid "INSERT INTO vars (name, blobval) VALUES ('genesis_hash', ?);" -msgstr "" - -#: wallet/wallet.c:3535 -msgid "SELECT txid, outnum FROM utxoset WHERE spendheight < ?" -msgstr "" - -#: wallet/wallet.c:3547 -msgid "DELETE FROM utxoset WHERE spendheight < ?" -msgstr "" - -#: wallet/wallet.c:3555 wallet/wallet.c:3669 -msgid "INSERT INTO blocks (height, hash, prev_hash) VALUES (?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3574 -msgid "DELETE FROM blocks WHERE hash = ?" -msgstr "" - -#: wallet/wallet.c:3580 -msgid "SELECT * FROM blocks WHERE height >= ?;" -msgstr "" - -#: wallet/wallet.c:3589 -msgid "DELETE FROM blocks WHERE height > ?" -msgstr "" - -#: wallet/wallet.c:3601 -msgid "UPDATE outputs SET spend_height = ?, status = ? WHERE prev_out_tx = ? AND prev_out_index = ?" -msgstr "" - -#: wallet/wallet.c:3619 -msgid "UPDATE utxoset SET spendheight = ? WHERE txid = ? AND outnum = ?" -msgstr "" - -#: wallet/wallet.c:3642 wallet/wallet.c:3680 -msgid "INSERT INTO utxoset ( txid, outnum, blockheight, spendheight, txindex, scriptpubkey, satoshis) VALUES(?, ?, ?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3706 -msgid "SELECT height FROM blocks WHERE height = ?" +#: wallet/wallet.c:3358 +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, local_offer_id FROM payments WHERE (payment_hash = ? OR ?) AND (status = ? OR ?) ORDER BY id;" msgstr "" -#: wallet/wallet.c:3719 -msgid "SELECT txid, spendheight, scriptpubkey, satoshis FROM utxoset WHERE blockheight = ? AND txindex = ? AND outnum = ? AND spendheight IS NULL" -msgstr "" - -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3783 -======= -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3775 -======= -#: wallet/wallet.c:3774 -======= -#: wallet/wallet.c:3341 -======= -#: wallet/wallet.c:3344 -======= -#: wallet/wallet.c:3351 ->>>>>>> plugin: Adding status to the pay plugin -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, local_offer_id FROM payments WHERE payment_hash = ? AND status = ? ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3376 -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, local_offer_id FROM payments WHERE payment_hash = ? ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3399 -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, local_offer_id FROM payments WHERE status = ? ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3422 -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, local_offer_id FROM payments ORDER BY id;" -msgstr "" - -#: wallet/wallet.c:3473 +#: wallet/wallet.c:3421 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, local_offer_id FROM payments WHERE local_offer_id = ?;" msgstr "" -#: wallet/wallet.c:3518 +#: wallet/wallet.c:3466 msgid "DELETE FROM htlc_sigs WHERE channelid = ?" msgstr "" -#: wallet/wallet.c:3525 +#: wallet/wallet.c:3473 msgid "INSERT INTO htlc_sigs (channelid, signature) VALUES (?, ?)" msgstr "" -#: wallet/wallet.c:3537 +#: wallet/wallet.c:3485 msgid "SELECT blobval FROM vars WHERE name='genesis_hash'" msgstr "" -#: wallet/wallet.c:3561 +#: wallet/wallet.c:3509 msgid "INSERT INTO vars (name, blobval) VALUES ('genesis_hash', ?);" msgstr "" -#: wallet/wallet.c:3579 +#: wallet/wallet.c:3527 msgid "SELECT txid, outnum FROM utxoset WHERE spendheight < ?" msgstr "" -#: wallet/wallet.c:3591 +#: wallet/wallet.c:3539 msgid "DELETE FROM utxoset WHERE spendheight < ?" msgstr "" -#: wallet/wallet.c:3599 wallet/wallet.c:3713 +#: wallet/wallet.c:3547 wallet/wallet.c:3661 msgid "INSERT INTO blocks (height, hash, prev_hash) VALUES (?, ?, ?);" msgstr "" -#: wallet/wallet.c:3618 +#: wallet/wallet.c:3566 msgid "DELETE FROM blocks WHERE hash = ?" msgstr "" -#: wallet/wallet.c:3624 +#: wallet/wallet.c:3572 msgid "SELECT * FROM blocks WHERE height >= ?;" msgstr "" -#: wallet/wallet.c:3633 +#: wallet/wallet.c:3581 msgid "DELETE FROM blocks WHERE height > ?" msgstr "" -#: wallet/wallet.c:3645 +#: wallet/wallet.c:3593 msgid "UPDATE outputs SET spend_height = ?, status = ? WHERE prev_out_tx = ? AND prev_out_index = ?" msgstr "" -#: wallet/wallet.c:3663 +#: wallet/wallet.c:3611 msgid "UPDATE utxoset SET spendheight = ? WHERE txid = ? AND outnum = ?" msgstr "" -#: wallet/wallet.c:3686 wallet/wallet.c:3724 +#: wallet/wallet.c:3634 wallet/wallet.c:3672 msgid "INSERT INTO utxoset ( txid, outnum, blockheight, spendheight, txindex, scriptpubkey, satoshis) VALUES(?, ?, ?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:3750 +#: wallet/wallet.c:3698 msgid "SELECT height FROM blocks WHERE height = ?" msgstr "" -#: wallet/wallet.c:3763 +#: wallet/wallet.c:3711 msgid "SELECT txid, spendheight, scriptpubkey, satoshis FROM utxoset WHERE blockheight = ? AND txindex = ? AND outnum = ? AND spendheight IS NULL" msgstr "" -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:3768 ->>>>>>> rpc: Integrate the status flow in the listsendpays command ->>>>>>> rpc: Integrate the status flow in the listsendpays command ->>>>>>> rpc: Integrate the status flow in the listsendpays command +#: wallet/wallet.c:3775 msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE spendheight = ?" msgstr "" -#: wallet/wallet.c:3800 +#: wallet/wallet.c:3792 msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE blockheight = ?" msgstr "" -#: wallet/wallet.c:3817 wallet/wallet.c:3977 +#: wallet/wallet.c:3809 wallet/wallet.c:3969 msgid "SELECT blockheight FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3827 +#: wallet/wallet.c:3819 msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:3848 +#: wallet/wallet.c:3840 msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" msgstr "" -#: wallet/wallet.c:3865 +#: wallet/wallet.c:3857 msgid "INSERT INTO transaction_annotations (txid, idx, location, type, channel) VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;" msgstr "" -#: wallet/wallet.c:3897 +#: wallet/wallet.c:3889 msgid "SELECT type, channel_id FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3913 +#: wallet/wallet.c:3905 msgid "UPDATE transactions SET type = ?, channel_id = ? WHERE id = ?" msgstr "" -#: wallet/wallet.c:3932 +#: wallet/wallet.c:3924 msgid "SELECT type FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:3955 +#: wallet/wallet.c:3947 msgid "SELECT rawtx FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:4001 +#: wallet/wallet.c:3993 msgid "SELECT blockheight, txindex FROM transactions WHERE id=?" msgstr "" -#: wallet/wallet.c:4029 +#: wallet/wallet.c:4021 msgid "SELECT id FROM transactions WHERE blockheight=?" msgstr "" -#: wallet/wallet.c:4048 +#: wallet/wallet.c:4040 msgid "INSERT INTO channeltxs ( channel_id, type, transaction_id, input_num, blockheight) VALUES (?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4072 +#: wallet/wallet.c:4064 msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;" msgstr "" -#: wallet/wallet.c:4093 +#: wallet/wallet.c:4085 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:4138 +#: wallet/wallet.c:4130 msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?" msgstr "" -#: wallet/wallet.c:4196 +#: wallet/wallet.c:4188 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:4255 +#: wallet/wallet.c:4247 msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;" msgstr "" -#: wallet/wallet.c:4304 +#: wallet/wallet.c:4296 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) WHERE (1 = ? OR f.state = ?) AND (1 = ? OR f.in_channel_scid = ?) AND (1 = ? OR f.out_channel_scid = ?)" msgstr "" -#: wallet/wallet.c:4426 +#: wallet/wallet.c:4418 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:4520 +#: wallet/wallet.c:4512 msgid "INSERT INTO penalty_bases ( channel_id, commitnum, txid, outnum, amount) VALUES (?, ?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4545 +#: wallet/wallet.c:4537 msgid "SELECT commitnum, txid, outnum, amount FROM penalty_bases WHERE channel_id = ?" msgstr "" -#: wallet/wallet.c:4569 +#: wallet/wallet.c:4561 msgid "DELETE FROM penalty_bases WHERE channel_id = ? AND commitnum = ?" msgstr "" -#: wallet/wallet.c:4587 +#: wallet/wallet.c:4579 msgid "SELECT 1 FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4600 +#: wallet/wallet.c:4592 msgid "INSERT INTO offers ( offer_id, bolt12, label, status) VALUES (?, ?, ?, ?);" msgstr "" -#: wallet/wallet.c:4627 +#: wallet/wallet.c:4619 msgid "SELECT bolt12, label, status FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4655 +#: wallet/wallet.c:4647 msgid "SELECT offer_id FROM offers;" msgstr "" -#: wallet/wallet.c:4681 +#: wallet/wallet.c:4673 msgid "UPDATE offers SET status=? WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4692 +#: wallet/wallet.c:4684 msgid "UPDATE invoices SET state=? WHERE state=? AND local_offer_id = ?;" msgstr "" -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:4720 -======= -<<<<<<< refs/remotes/ElementsProject/master #: wallet/wallet.c:4712 -======= -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:4711 -======= -#: wallet/wallet.c:4705 -======= -#: wallet/wallet.c:3773 -======= -#: wallet/wallet.c:3798 ->>>>>>> wallet db: Support the query on database with status and payment hash. -msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE spendheight = ?" -msgstr "" - -#: wallet/wallet.c:3829 wallet/wallet.c:3989 -msgid "SELECT blockheight FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3839 -msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3860 -msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:3877 -======= -#: wallet/wallet.c:3827 -msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE spendheight = ?" -msgstr "" - -#: wallet/wallet.c:3844 -msgid "SELECT blockheight, txindex, outnum FROM utxoset WHERE blockheight = ?" -msgstr "" - -#: wallet/wallet.c:3861 wallet/wallet.c:4021 -msgid "SELECT blockheight FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3871 -msgid "INSERT INTO transactions ( id, blockheight, txindex, rawtx) VALUES (?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:3892 -msgid "UPDATE transactions SET blockheight = ?, txindex = ? WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:3909 ->>>>>>> plugin: Adding status to the pay plugin -msgid "INSERT INTO transaction_annotations (txid, idx, location, type, channel) VALUES (?, ?, ?, ?, ?) ON CONFLICT(txid,idx) DO NOTHING;" -msgstr "" - -#: wallet/wallet.c:3941 -msgid "SELECT type, channel_id FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3957 -msgid "UPDATE transactions SET type = ?, channel_id = ? WHERE id = ?" -msgstr "" - -#: wallet/wallet.c:3976 -msgid "SELECT type FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:3999 -msgid "SELECT rawtx FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:4045 -msgid "SELECT blockheight, txindex FROM transactions WHERE id=?" -msgstr "" - -#: wallet/wallet.c:4073 -msgid "SELECT id FROM transactions WHERE blockheight=?" -msgstr "" - -#: wallet/wallet.c:4092 -msgid "INSERT INTO channeltxs ( channel_id, type, transaction_id, input_num, blockheight) VALUES (?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:4116 -msgid "SELECT DISTINCT(channel_id) FROM channeltxs WHERE type = ?;" -msgstr "" - -#: wallet/wallet.c:4137 -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:4182 -msgid "UPDATE forwarded_payments SET in_msatoshi=?, out_msatoshi=?, state=?, resolved_time=?, failcode=? WHERE in_htlc_id=?" -msgstr "" - -#: wallet/wallet.c:4240 -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:4299 -msgid "SELECT CAST(COALESCE(SUM(in_msatoshi - out_msatoshi), 0) AS BIGINT)FROM forwarded_payments WHERE state = ?;" -msgstr "" - -#: wallet/wallet.c:4348 -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) WHERE (1 = ? OR f.state = ?) AND (1 = ? OR f.in_channel_scid = ?) AND (1 = ? OR f.out_channel_scid = ?)" -msgstr "" - -#: wallet/wallet.c:4470 -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:4564 -msgid "INSERT INTO penalty_bases ( channel_id, commitnum, txid, outnum, amount) VALUES (?, ?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:4589 -msgid "SELECT commitnum, txid, outnum, amount FROM penalty_bases WHERE channel_id = ?" -msgstr "" - -#: wallet/wallet.c:4613 -msgid "DELETE FROM penalty_bases WHERE channel_id = ? AND commitnum = ?" -msgstr "" - -#: wallet/wallet.c:4631 -msgid "SELECT 1 FROM offers WHERE offer_id = ?;" -msgstr "" - -#: wallet/wallet.c:4644 -msgid "INSERT INTO offers ( offer_id, bolt12, label, status) VALUES (?, ?, ?, ?);" -msgstr "" - -#: wallet/wallet.c:4671 -msgid "SELECT bolt12, label, status FROM offers WHERE offer_id = ?;" -msgstr "" - -#: wallet/wallet.c:4699 -msgid "SELECT offer_id FROM offers;" -msgstr "" - -#: wallet/wallet.c:4725 -msgid "UPDATE offers SET status=? WHERE offer_id = ?;" -msgstr "" - -#: wallet/wallet.c:4736 -msgid "UPDATE invoices SET state=? WHERE state=? AND local_offer_id = ?;" -msgstr "" - -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -#: wallet/wallet.c:4707 ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -======= -======= -======= -======= -#: wallet/wallet.c:4732 ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. -msgid "SELECT status FROM offers WHERE offer_id = ?;" -msgstr "" - -#: wallet/wallet.c:4805 -msgid "UPDATE datastore SET data=?, generation=generation+1 WHERE key=?;" -msgstr "" - -#: wallet/wallet.c:4816 -msgid "INSERT INTO datastore VALUES (?, ?, 0);" -msgstr "" - -#: wallet/wallet.c:4827 -msgid "DELETE FROM datastore WHERE key = ?" -msgstr "" - -#: wallet/wallet.c:4844 -msgid "SELECT key, data, generation FROM datastore WHERE key >= ? ORDER BY key;" -msgstr "" - -#: wallet/wallet.c:4851 -======= -#: wallet/wallet.c:4764 msgid "SELECT status FROM offers WHERE offer_id = ?;" msgstr "" -#: wallet/wallet.c:4849 +#: wallet/wallet.c:4797 msgid "UPDATE datastore SET data=?, generation=generation+1 WHERE key=?;" msgstr "" -#: wallet/wallet.c:4860 +#: wallet/wallet.c:4808 msgid "INSERT INTO datastore VALUES (?, ?, 0);" msgstr "" -#: wallet/wallet.c:4871 +#: wallet/wallet.c:4819 msgid "DELETE FROM datastore WHERE key = ?" msgstr "" -#: wallet/wallet.c:4888 +#: wallet/wallet.c:4836 msgid "SELECT key, data, generation FROM datastore WHERE key >= ? ORDER BY key;" msgstr "" -#: wallet/wallet.c:4895 ->>>>>>> plugin: Adding status to the pay plugin +#: wallet/wallet.c:4843 msgid "SELECT key, data, generation FROM datastore ORDER BY key;" msgstr "" @@ -1673,132 +1365,4 @@ msgstr "" #: wallet/test/run-wallet.c:1754 msgid "INSERT INTO channels (id) VALUES (1);" msgstr "" -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:651a6c15e8780351cd32a4e6dc3011b1c5fc2af6308b0e65a442dda2a3874e19 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -======= ->>>>>>> plugin: Adding status to the pay plugin -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:35e10cb3ec34af54b6d78d9eea1aefa0861ef9acbfe0e78745d24b8e49e50b05 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:d098fea63dcba84aefff5cf924cbc455caf9d2ec13cb28ad9ab929bb001a12e6 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:e7f23b938c7ee86b0178ca11d8d3df3f08dec52e205e0778be1f5a0b607f52f6 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:8878e1ee71d04ea6302c18aeb02f59c56e086a7e5a4647ddbe67bc2ef7c07275 -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:51fa10c40312c4845f05157420486d57cc8c5ace7b7da7a92c8e496f48ff0dcc -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:d0ba3b9e4e392f7327662f333f4712582f7553a819d588ebb3641b229215e90f -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:3652b5850f08383c0f0c01a7f11c1a22ec2b4ac16018152d2770a73674fb05ec -======= -======= ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master -# SHA256STAMP:e203d19d9f4192ad6b3aa1a6f257d4f7b267df56c5de9810b573f0affa0122fd -======= -# SHA256STAMP:e074dc48b7055c740baa4da907a743baf1048d03dca12ebd1ed5989a9b0b7549 ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> rpc: Integrate the status flow in the listsendpays command -======= -======= -======= -======= -======= -======= -======= -======= -======= -# SHA256STAMP:697c27016716f435d1ecb4ec3fca117316f779d88c02dbde7ea3214b4bc0a2c7 ->>>>>>> wallet db: Support the query on database with status and payment hash. ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> wallet db: Support the query on database with status and payment hash. -======= -======= -======= -======= -======= -======= -======= -======= -# SHA256STAMP:de612e43f4a76fed487047d802d20cc7185cf5650ed31bc01efb89c495bfbb14 ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported ->>>>>>> doc: Update doc with the new parameter supported -<<<<<<< refs/remotes/ElementsProject/master ->>>>>>> doc: Update doc with the new parameter supported -======= -======= -# SHA256STAMP:721561d65cdfbde26634a75453d7816c6533f3ff3f32f2f7ee67337ce58b39a7 ->>>>>>> plugin: Adding status to the pay plugin ->>>>>>> plugin: Adding status to the pay plugin +# SHA256STAMP:c69454f0610460f3761f422efbe3f52c78f6a7f2b0b76ca2b333fe41233a8109 diff --git a/wallet/wallet.c b/wallet/wallet.c index 21eb247ff5c5..365e1f4fb313 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -3351,103 +3351,43 @@ wallet_payment_list(const tal_t *ctx, size_t i; payments = tal_arr(ctx, const struct wallet_payment *, 0); - //FIXME: Make the if-else smaller - // A possible solution is divided the string in two part (pre-where and post-where) and - // use a small if else to set the remain string, with this method we can have small code. - if (payment_hash && status) { - stmt = - db_prepare_v2(wallet->db, SQL("SELECT" - " id" - ", status" - ", destination" - ", msatoshi" - ", payment_hash" - ", timestamp" - ", payment_preimage" - ", path_secrets" - ", route_nodes" - ", route_channels" - ", msatoshi_sent" - ", description" - ", bolt11" - ", failonionreply" - ", total_msat" - ", partid" - ", local_offer_id" - " FROM payments" - " WHERE payment_hash = ? AND status = ?" - " ORDER BY id;")); - db_bind_sha256(stmt, 0, payment_hash); - db_bind_int(stmt, 1, wallet_payment_status_in_db(*status)); - } else if (payment_hash) { - stmt = - db_prepare_v2(wallet->db, SQL("SELECT" - " id" - ", status" - ", destination" - ", msatoshi" - ", payment_hash" - ", timestamp" - ", payment_preimage" - ", path_secrets" - ", route_nodes" - ", route_channels" - ", msatoshi_sent" - ", description" - ", bolt11" - ", failonionreply" - ", total_msat" - ", partid" - ", local_offer_id" - " FROM payments" - " WHERE payment_hash = ?" - " ORDER BY id;")); + + uint8_t enable_payment_hash = payment_hash != NULL ? 0 : 1; + uint8_t enable_status = status != NULL ? 0 : 1; + + stmt = db_prepare_v2(wallet->db, SQL("SELECT" + " id" + ", status" + ", destination" + ", msatoshi" + ", payment_hash" + ", timestamp" + ", payment_preimage" + ", path_secrets" + ", route_nodes" + ", route_channels" + ", msatoshi_sent" + ", description" + ", bolt11" + ", failonionreply" + ", total_msat" + ", partid" + ", local_offer_id" + " FROM payments" + " WHERE (payment_hash = ? OR ?) AND (status = ? OR ?)" + " ORDER BY id;")); + + if (payment_hash) db_bind_sha256(stmt, 0, payment_hash); - } else if (status) { - stmt = db_prepare_v2(wallet->db, SQL("SELECT" - " id" - ", status" - ", destination" - ", msatoshi" - ", payment_hash" - ", timestamp" - ", payment_preimage" - ", path_secrets" - ", route_nodes" - ", route_channels" - ", msatoshi_sent" - ", description" - ", bolt11" - ", failonionreply" - ", total_msat" - ", partid" - ", local_offer_id" - " FROM payments" - " WHERE status = ?" - " ORDER BY id;")); - db_bind_int(stmt, 0, wallet_payment_status_in_db(*status)); - } else { - stmt = db_prepare_v2(wallet->db, SQL("SELECT" - " id" - ", status" - ", destination" - ", msatoshi" - ", payment_hash" - ", timestamp" - ", payment_preimage" - ", path_secrets" - ", route_nodes" - ", route_channels" - ", msatoshi_sent" - ", description" - ", bolt11" - ", failonionreply" - ", total_msat" - ", partid" - ", local_offer_id" - " FROM payments" - " ORDER BY id;")); - } + else + db_bind_null(stmt, 0); + db_bind_int(stmt, 1, enable_payment_hash); + if (status) + db_bind_int(stmt, 2, wallet_payment_status_in_db(*status)); + else + db_bind_null(stmt, 2); + db_bind_int(stmt, 3, enable_status); + db_query_prepared(stmt); for (i = 0; db_step(stmt); i++) { diff --git a/wire/channel_type_printgen.c b/wire/channel_type_printgen.c new file mode 100644 index 000000000000..889b1a5ca5a2 --- /dev/null +++ b/wire/channel_type_printgen.c @@ -0,0 +1,32 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ + +#include "wire/channel_type_printgen.h" +#include +#include +#include +#include +#include +#include + + + +void printwire_channel_type(const char *fieldname, const u8 **cursor, size_t *plen) +{ + + u16 len = fromwire_u16(cursor, plen); + if (!*cursor) { + printf("**TRUNCATED**\n"); + return; + } + printf("features="); + printwire_u8_array(tal_fmt(NULL, "%s.features", fieldname), cursor, plen, len); + + if (!*cursor) { + printf("**TRUNCATED**\n"); + return; + } + +} + +// SHA256STAMP:330d760a1b4a95ca2b91e3343053345b2e0c570a5d8cb601b890f1ce6a2b78f9 diff --git a/wire/channel_type_printgen.h b/wire/channel_type_printgen.h new file mode 100644 index 000000000000..927e959461c5 --- /dev/null +++ b/wire/channel_type_printgen.h @@ -0,0 +1,16 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ +/* Template located at tools/gen/print_header_template */ +#ifndef LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H +#define LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H +#include +#include + +void printchannel_type_wire_message(const u8 *msg); + +void printchannel_type_wire_tlv_message(const char *tlv_name, const u8 *msg); + + +void printwire_channel_type(const char *fieldname, const u8 **cursor, size_t *plen); +#endif /* LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H */ +// SHA256STAMP:330d760a1b4a95ca2b91e3343053345b2e0c570a5d8cb601b890f1ce6a2b78f9 diff --git a/wire/channel_type_wiregen.c b/wire/channel_type_wiregen.c new file mode 100644 index 000000000000..8eb6ead4f302 --- /dev/null +++ b/wire/channel_type_wiregen.c @@ -0,0 +1,42 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ +/* Original template can be found at tools/gen/impl_template */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef SUPERVERBOSE +#define SUPERVERBOSE(...) +#endif + + + + +/* SUBTYPE: CHANNEL_TYPE */ +/* Why not let our generator generate this too? */ +void towire_channel_type(u8 **p, const struct channel_type *channel_type) +{ + u16 len = tal_count(channel_type->features); + + towire_u16(p, len); + towire_u8_array(p, channel_type->features, len); +} +struct channel_type * +fromwire_channel_type(const tal_t *ctx, const u8 **cursor, size_t *plen) +{ + struct channel_type *channel_type = tal(ctx, struct channel_type); + u16 len; + + len = fromwire_u16(cursor, plen); + channel_type->features = tal_arr(channel_type, u8, len); +fromwire_u8_array(cursor, plen, channel_type->features, len); + + return channel_type; +} + +// SHA256STAMP:330d760a1b4a95ca2b91e3343053345b2e0c570a5d8cb601b890f1ce6a2b78f9 diff --git a/wire/channel_type_wiregen.h b/wire/channel_type_wiregen.h new file mode 100644 index 000000000000..cc0f6ab038f8 --- /dev/null +++ b/wire/channel_type_wiregen.h @@ -0,0 +1,23 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the _csv file it was generated from. */ +/* Original template can be found at tools/gen/header_template */ + +#ifndef LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H +#define LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H +#include +#include +#include + + +struct channel_type { + u8 *features; +}; + +/* SUBTYPE: CHANNEL_TYPE */ +/* Why not let our generator generate this too? */ +void towire_channel_type(u8 **p, const struct channel_type *channel_type); +struct channel_type *fromwire_channel_type(const tal_t *ctx, const u8 **cursor, size_t *plen); + + +#endif /* LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H */ +// SHA256STAMP:330d760a1b4a95ca2b91e3343053345b2e0c570a5d8cb601b890f1ce6a2b78f9