inflights: save the whole psbt to the database

Otherwise we're missing info when we go to broadcast these and can't
properly sign the transaction to close it.

Found-by: @jasan
This commit is contained in:
niftynei 2021-05-19 19:15:12 -05:00 committed by Rusty Russell
parent 1d922bff1c
commit 4247ec3a05
7 changed files with 324 additions and 179 deletions

Binary file not shown.

View file

@ -143,6 +143,28 @@ def test_scid_upgrade(node_factory, bitcoind):
assert l1.db_query('SELECT failchannel from payments;') == [{'failchannel': '103x1x1'}]
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
def test_last_tx_inflight_psbt_upgrade(node_factory, bitcoind):
bitcoind.generate_block(12)
prior_txs = ['02000000019CCCA2E59D863B00B5BD835BF7BA93CC257932D2C7CDBE51EFE2EE4A9D29DFCB01000000009DB0E280024A01000000000000220020BE7935A77CA9AB70A4B8B1906825637767FED3C00824AA90C988983587D68488F0820100000000002200209F4684DDB28ACDC73959BC194D1A25DF906F61ED030F52D163E6F1E247D32CBB9A3ED620', '020000000122F9EBE38F54208545B681AD7F73A7AE3504A09C8201F502673D34E28424687C01000000009DB0E280024A01000000000000220020BE7935A77CA9AB70A4B8B1906825637767FED3C00824AA90C988983587D68488F0820100000000002200209F4684DDB28ACDC73959BC194D1A25DF906F61ED030F52D163E6F1E247D32CBB9A3ED620']
l1 = node_factory.get_node(dbfile='upgrade_inflight.sqlite3.xz')
b64_last_txs = [base64.b64encode(x['last_tx']).decode('utf-8') for x in l1.db_query('SELECT last_tx FROM channel_funding_inflights ORDER BY channel_id, funding_feerate;')]
for i in range(len(b64_last_txs)):
bpsbt = b64_last_txs[i]
psbt = bitcoind.rpc.decodepsbt(bpsbt)
tx = prior_txs[i]
assert psbt['tx']['txid'] == bitcoind.rpc.decoderawtransaction(tx)['txid']
funding_input = only_one(psbt['inputs'])
assert funding_input['witness_utxo']['amount'] == Decimal('0.001')
assert funding_input['witness_utxo']['scriptPubKey']['type'] == 'witness_v0_scripthash'
assert funding_input['witness_script']['type'] == 'multisig'
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")

View file

@ -48,6 +48,10 @@ static void migrate_our_funding(struct lightningd *ld, struct db *db,
static void migrate_last_tx_to_psbt(struct lightningd *ld, struct db *db,
const struct migration_context *mc);
static void
migrate_inflight_last_tx_to_psbt(struct lightningd *ld, struct db *db,
const struct migration_context *mc);
static void fillin_missing_scriptpubkeys(struct lightningd *ld, struct db *db,
const struct migration_context *mc);
@ -712,6 +716,7 @@ static struct migration dbmigrations[] = {
/* Oops, can I haz money back plz? */
{SQL("ALTER TABLE channels ADD shutdown_wrong_txid BLOB DEFAULT NULL"), NULL},
{SQL("ALTER TABLE channels ADD shutdown_wrong_outnum INTEGER DEFAULT NULL"), NULL},
{NULL, migrate_inflight_last_tx_to_psbt},
};
/* Leak tracking. */
@ -1404,6 +1409,92 @@ static void fillin_missing_local_basepoints(struct lightningd *ld,
tal_free(stmt);
}
void
migrate_inflight_last_tx_to_psbt(struct lightningd *ld, struct db *db,
const struct migration_context *mc)
{
struct db_stmt *stmt, *update_stmt;
stmt = db_prepare_v2(db, SQL("SELECT "
" c.id"
", p.node_id"
", c.fundingkey_remote"
", inflight.last_tx"
", inflight.last_sig"
", inflight.funding_satoshi"
", inflight.funding_tx_id"
" FROM channels c"
" LEFT OUTER JOIN peers p"
" ON p.id = c.peer_id"
" LEFT OUTER JOIN"
" channel_funding_inflights inflight"
" ON c.id = inflight.channel_id"
" WHERE inflight.last_tx IS NOT NULL;"));
db_query_prepared(stmt);
while (db_step(stmt)) {
struct bitcoin_tx *last_tx;
struct bitcoin_txid funding_txid;
struct amount_sat funding_sat;
struct node_id peer_id;
struct pubkey local_funding_pubkey, remote_funding_pubkey;
struct basepoints local_basepoints UNUSED;
struct bitcoin_signature last_sig;
u64 cdb_id;
u8 *funding_wscript;
cdb_id = db_column_u64(stmt, 0);
last_tx = db_column_tx(stmt, stmt, 3);
assert(last_tx != NULL);
/* If we've forgotten about the peer_id
* because we closed / forgot the channel,
* we can skip this. */
if (db_column_is_null(stmt, 1))
continue;
db_column_node_id(stmt, 1, &peer_id);
db_column_amount_sat(stmt, 5, &funding_sat);
db_column_pubkey(stmt, 2, &remote_funding_pubkey);
db_column_txid(stmt, 6, &funding_txid);
get_channel_basepoints(ld, &peer_id, cdb_id,
&local_basepoints, &local_funding_pubkey);
funding_wscript = bitcoin_redeem_2of2(stmt, &local_funding_pubkey,
&remote_funding_pubkey);
psbt_input_set_wit_utxo(last_tx->psbt, 0,
scriptpubkey_p2wsh(last_tx->psbt, funding_wscript),
funding_sat);
psbt_input_set_witscript(last_tx->psbt, 0, funding_wscript);
if (!db_column_signature(stmt, 4, &last_sig.s))
abort();
last_sig.sighash_type = SIGHASH_ALL;
if (!psbt_input_set_signature(last_tx->psbt, 0,
&remote_funding_pubkey, &last_sig))
abort();
psbt_input_add_pubkey(last_tx->psbt, 0,
&local_funding_pubkey);
psbt_input_add_pubkey(last_tx->psbt, 0,
&remote_funding_pubkey);
update_stmt = db_prepare_v2(db,
SQL("UPDATE channel_funding_inflights"
" SET last_tx = ?"
" WHERE channel_id = ?"
" AND funding_tx_id = ?;"));
db_bind_psbt(update_stmt, 0, last_tx->psbt);
db_bind_int(update_stmt, 1, cdb_id);
db_bind_txid(update_stmt, 2, &funding_txid);
db_exec_prepared_v2(update_stmt);
tal_free(update_stmt);
}
tal_free(stmt);
}
/* We're moving everything over to PSBTs from tx's, particularly our last_tx's
* which are commitment transactions for channels.
* This migration loads all of the last_tx's and 're-formats' them into psbts,

View file

@ -1034,6 +1034,18 @@ struct db_query db_postgres_queries[] = {
.placeholders = 6,
.readonly = false,
},
{
.name = "SELECT c.id, p.node_id, c.fundingkey_remote, inflight.last_tx, inflight.last_sig, inflight.funding_satoshi, inflight.funding_tx_id FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id LEFT OUTER JOIN channel_funding_inflights inflight ON c.id = inflight.channel_id WHERE inflight.last_tx IS NOT NULL;",
.query = "SELECT c.id, p.node_id, c.fundingkey_remote, inflight.last_tx, inflight.last_sig, inflight.funding_satoshi, inflight.funding_tx_id FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id LEFT OUTER JOIN channel_funding_inflights inflight ON c.id = inflight.channel_id WHERE inflight.last_tx IS NOT NULL;",
.placeholders = 0,
.readonly = true,
},
{
.name = "UPDATE channel_funding_inflights SET last_tx = ? WHERE channel_id = ? AND funding_tx_id = ?;",
.query = "UPDATE channel_funding_inflights SET last_tx = $1 WHERE channel_id = $2 AND funding_tx_id = $3;",
.placeholders = 3,
.readonly = false,
},
{
.name = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
.query = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
@ -1882,10 +1894,10 @@ struct db_query db_postgres_queries[] = {
},
};
#define DB_POSTGRES_QUERY_COUNT 312
#define DB_POSTGRES_QUERY_COUNT 314
#endif /* HAVE_POSTGRES */
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:78e8a75719f367a070874e2b4813b0b8ff3a74a51844c7e7a06b5f8cc18a414b
// SHA256STAMP:dbebcde72bd359ea7edaf5732c78549224c3b891e45f123696b4cfd60dd9037b

View file

@ -1034,6 +1034,18 @@ struct db_query db_sqlite3_queries[] = {
.placeholders = 6,
.readonly = false,
},
{
.name = "SELECT c.id, p.node_id, c.fundingkey_remote, inflight.last_tx, inflight.last_sig, inflight.funding_satoshi, inflight.funding_tx_id FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id LEFT OUTER JOIN channel_funding_inflights inflight ON c.id = inflight.channel_id WHERE inflight.last_tx IS NOT NULL;",
.query = "SELECT c.id, p.node_id, c.fundingkey_remote, inflight.last_tx, inflight.last_sig, inflight.funding_satoshi, inflight.funding_tx_id FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id LEFT OUTER JOIN channel_funding_inflights inflight ON c.id = inflight.channel_id WHERE inflight.last_tx IS NOT NULL;",
.placeholders = 0,
.readonly = true,
},
{
.name = "UPDATE channel_funding_inflights SET last_tx = ? WHERE channel_id = ? AND funding_tx_id = ?;",
.query = "UPDATE channel_funding_inflights SET last_tx = ? WHERE channel_id = ? AND funding_tx_id = ?;",
.placeholders = 3,
.readonly = false,
},
{
.name = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
.query = "SELECT c.id, p.node_id, c.last_tx, c.funding_satoshi, c.fundingkey_remote, c.last_sig FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id;",
@ -1882,10 +1894,10 @@ struct db_query db_sqlite3_queries[] = {
},
};
#define DB_SQLITE3_QUERY_COUNT 312
#define DB_SQLITE3_QUERY_COUNT 314
#endif /* HAVE_SQLITE3 */
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
// SHA256STAMP:78e8a75719f367a070874e2b4813b0b8ff3a74a51844c7e7a06b5f8cc18a414b
// SHA256STAMP:dbebcde72bd359ea7edaf5732c78549224c3b891e45f123696b4cfd60dd9037b

View file

@ -1,692 +1,700 @@
#: wallet/db.c:65
#: wallet/db.c:69
msgid "CREATE TABLE version (version INTEGER)"
msgstr ""
#: wallet/db.c:66
#: wallet/db.c:70
msgid "INSERT INTO version VALUES (1)"
msgstr ""
#: wallet/db.c:67
#: wallet/db.c:71
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:76
#: wallet/db.c:80
msgid "CREATE TABLE vars ( name VARCHAR(32), val VARCHAR(255), PRIMARY KEY (name));"
msgstr ""
#: wallet/db.c:82
#: wallet/db.c:86
msgid "CREATE TABLE shachains ( id BIGSERIAL, min_index BIGINT, num_valid BIGINT, PRIMARY KEY (id));"
msgstr ""
#: wallet/db.c:89
#: wallet/db.c:93
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:97
#: wallet/db.c:101
msgid "CREATE TABLE peers ( id BIGSERIAL, node_id BLOB UNIQUE, address TEXT, PRIMARY KEY (id));"
msgstr ""
#: wallet/db.c:104
#: wallet/db.c:108
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:146
#: wallet/db.c:150
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:157
#: wallet/db.c:161
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:177
#: wallet/db.c:181
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:189
#: wallet/db.c:193
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:202
#: wallet/db.c:206
msgid "ALTER TABLE invoices ADD expiry_time BIGINT;"
msgstr ""
#: wallet/db.c:203
#: wallet/db.c:207
msgid "UPDATE invoices SET expiry_time=9223372036854775807;"
msgstr ""
#: wallet/db.c:205
#: wallet/db.c:209
msgid "ALTER TABLE invoices ADD pay_index BIGINT;"
msgstr ""
#: wallet/db.c:206
#: wallet/db.c:210
msgid "CREATE UNIQUE INDEX invoices_pay_index ON invoices(pay_index);"
msgstr ""
#: wallet/db.c:208
#: wallet/db.c:212
msgid "UPDATE invoices SET pay_index=id WHERE state=1;"
msgstr ""
#: wallet/db.c:211
#: wallet/db.c:215
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:220
#: wallet/db.c:224
msgid "ALTER TABLE channels ADD first_blocknum BIGINT;"
msgstr ""
#: wallet/db.c:221
#: wallet/db.c:225
msgid "UPDATE channels SET first_blocknum=1 WHERE short_channel_id IS NOT NULL;"
msgstr ""
#: wallet/db.c:223
#: wallet/db.c:227
msgid "ALTER TABLE outputs ADD COLUMN channel_id BIGINT;"
msgstr ""
#: wallet/db.c:224
#: wallet/db.c:228
msgid "ALTER TABLE outputs ADD COLUMN peer_id BLOB;"
msgstr ""
#: wallet/db.c:225
#: wallet/db.c:229
msgid "ALTER TABLE outputs ADD COLUMN commitment_point BLOB;"
msgstr ""
#: wallet/db.c:226
#: wallet/db.c:230
msgid "ALTER TABLE invoices ADD COLUMN msatoshi_received BIGINT;"
msgstr ""
#: wallet/db.c:228
#: wallet/db.c:232
msgid "UPDATE invoices SET msatoshi_received=0 WHERE state=1;"
msgstr ""
#: wallet/db.c:229
#: wallet/db.c:233
msgid "ALTER TABLE channels ADD COLUMN last_was_revoke INTEGER;"
msgstr ""
#: wallet/db.c:233 wallet/db.c:526
#: wallet/db.c:237 wallet/db.c:530
msgid "ALTER TABLE payments RENAME TO temp_payments;"
msgstr ""
#: wallet/db.c:234
#: wallet/db.c:238
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:245
#: wallet/db.c:249
msgid "INSERT INTO payments SELECT id, timestamp, status, payment_hash, destination, msatoshi FROM temp_payments WHERE direction=1;"
msgstr ""
#: wallet/db.c:248 wallet/db.c:601
#: wallet/db.c:252 wallet/db.c:605
msgid "DROP TABLE temp_payments;"
msgstr ""
#: wallet/db.c:250
#: wallet/db.c:254
msgid "ALTER TABLE payments ADD COLUMN payment_preimage BLOB;"
msgstr ""
#: wallet/db.c:252
#: wallet/db.c:256
msgid "ALTER TABLE payments ADD COLUMN path_secrets BLOB;"
msgstr ""
#: wallet/db.c:255
#: wallet/db.c:259
msgid "ALTER TABLE invoices ADD paid_timestamp BIGINT;"
msgstr ""
#: wallet/db.c:256
#: wallet/db.c:260
msgid "UPDATE invoices SET paid_timestamp = CURRENT_TIMESTAMP() WHERE state = 1;"
msgstr ""
#: wallet/db.c:264
#: wallet/db.c:268
msgid "ALTER TABLE payments ADD COLUMN route_nodes BLOB;"
msgstr ""
#: wallet/db.c:265
#: wallet/db.c:269
msgid "ALTER TABLE payments ADD COLUMN route_channels BLOB;"
msgstr ""
#: wallet/db.c:266
#: wallet/db.c:270
msgid "CREATE TABLE htlc_sigs (channelid INTEGER REFERENCES channels(id) ON DELETE CASCADE, signature BLOB);"
msgstr ""
#: wallet/db.c:269
#: wallet/db.c:273
msgid "CREATE INDEX channel_idx ON htlc_sigs (channelid)"
msgstr ""
#: wallet/db.c:271
#: wallet/db.c:275
msgid "DELETE FROM channels WHERE state=1"
msgstr ""
#: wallet/db.c:273
#: wallet/db.c:277
msgid "CREATE TABLE db_upgrades (upgrade_from INTEGER, lightning_version TEXT);"
msgstr ""
#: wallet/db.c:277 wallet/db.c:467
#: wallet/db.c:281 wallet/db.c:471
msgid "DELETE FROM peers WHERE id NOT IN (SELECT peer_id FROM channels);"
msgstr ""
#: wallet/db.c:281
#: wallet/db.c:285
msgid "UPDATE channels SET STATE = 8 WHERE state > 8;"
msgstr ""
#: wallet/db.c:283
#: wallet/db.c:287
msgid "ALTER TABLE invoices ADD bolt11 TEXT;"
msgstr ""
#: wallet/db.c:287
#: wallet/db.c:291
msgid "CREATE TABLE blocks (height INT, hash BLOB, prev_hash BLOB, UNIQUE(height));"
msgstr ""
#: wallet/db.c:297
#: wallet/db.c:301
msgid "ALTER TABLE outputs ADD COLUMN confirmation_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;"
msgstr ""
#: wallet/db.c:300
#: wallet/db.c:304
msgid "ALTER TABLE outputs ADD COLUMN spend_height INTEGER REFERENCES blocks(height) ON DELETE SET NULL;"
msgstr ""
#: wallet/db.c:304
#: wallet/db.c:308
msgid "CREATE INDEX output_height_idx ON outputs (confirmation_height, spend_height);"
msgstr ""
#: wallet/db.c:307
#: wallet/db.c:311
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:317
#: wallet/db.c:321
msgid "CREATE INDEX short_channel_id ON utxoset (blockheight, txindex, outnum)"
msgstr ""
#: wallet/db.c:322
#: wallet/db.c:326
msgid "CREATE INDEX utxoset_spend ON utxoset (spendheight)"
msgstr ""
#: wallet/db.c:324
#: wallet/db.c:328
msgid "UPDATE channels SET shutdown_keyidx_local=0 WHERE shutdown_keyidx_local = -1;"
msgstr ""
#: wallet/db.c:330
#: wallet/db.c:334
msgid "ALTER TABLE payments ADD failonionreply BLOB;"
msgstr ""
#: wallet/db.c:332
#: wallet/db.c:336
msgid "ALTER TABLE payments ADD faildestperm INTEGER;"
msgstr ""
#: wallet/db.c:334
#: wallet/db.c:338
msgid "ALTER TABLE payments ADD failindex INTEGER;"
msgstr ""
#: wallet/db.c:336
#: wallet/db.c:340
msgid "ALTER TABLE payments ADD failcode INTEGER;"
msgstr ""
#: wallet/db.c:337
#: wallet/db.c:341
msgid "ALTER TABLE payments ADD failnode BLOB;"
msgstr ""
#: wallet/db.c:338
#: wallet/db.c:342
msgid "ALTER TABLE payments ADD failchannel TEXT;"
msgstr ""
#: wallet/db.c:340
#: wallet/db.c:344
msgid "ALTER TABLE payments ADD failupdate BLOB;"
msgstr ""
#: wallet/db.c:344
#: wallet/db.c:348
msgid "UPDATE payments SET path_secrets = NULL , route_nodes = NULL , route_channels = NULL WHERE status <> 0;"
msgstr ""
#: wallet/db.c:351
#: wallet/db.c:355
msgid "ALTER TABLE channels ADD in_payments_offered INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:352
#: wallet/db.c:356
msgid "ALTER TABLE channels ADD in_payments_fulfilled INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:353
#: wallet/db.c:357
msgid "ALTER TABLE channels ADD in_msatoshi_offered BIGINT DEFAULT 0;"
msgstr ""
#: wallet/db.c:354
#: wallet/db.c:358
msgid "ALTER TABLE channels ADD in_msatoshi_fulfilled BIGINT DEFAULT 0;"
msgstr ""
#: wallet/db.c:355
#: wallet/db.c:359
msgid "ALTER TABLE channels ADD out_payments_offered INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:356
#: wallet/db.c:360
msgid "ALTER TABLE channels ADD out_payments_fulfilled INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:357
#: wallet/db.c:361
msgid "ALTER TABLE channels ADD out_msatoshi_offered BIGINT DEFAULT 0;"
msgstr ""
#: wallet/db.c:358
#: wallet/db.c:362
msgid "ALTER TABLE channels ADD out_msatoshi_fulfilled BIGINT DEFAULT 0;"
msgstr ""
#: wallet/db.c:359
#: wallet/db.c:363
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:368
#: wallet/db.c:372
msgid "ALTER TABLE payments ADD msatoshi_sent BIGINT;"
msgstr ""
#: wallet/db.c:369
#: wallet/db.c:373
msgid "UPDATE payments SET msatoshi_sent = msatoshi;"
msgstr ""
#: wallet/db.c:371
#: wallet/db.c:375
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:379
#: wallet/db.c:383
msgid "ALTER TABLE channels ADD min_possible_feerate INTEGER;"
msgstr ""
#: wallet/db.c:380
#: wallet/db.c:384
msgid "ALTER TABLE channels ADD max_possible_feerate INTEGER;"
msgstr ""
#: wallet/db.c:383
#: wallet/db.c:387
msgid "UPDATE channels SET min_possible_feerate=0, max_possible_feerate=250000;"
msgstr ""
#: wallet/db.c:387
#: wallet/db.c:391
msgid "ALTER TABLE channels ADD msatoshi_to_us_min BIGINT;"
msgstr ""
#: wallet/db.c:388
#: wallet/db.c:392
msgid "ALTER TABLE channels ADD msatoshi_to_us_max BIGINT;"
msgstr ""
#: wallet/db.c:389
#: wallet/db.c:393
msgid "UPDATE channels SET msatoshi_to_us_min = msatoshi_local , msatoshi_to_us_max = msatoshi_local ;"
msgstr ""
#: wallet/db.c:398
#: wallet/db.c:402
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:407
#: wallet/db.c:411
msgid "ALTER TABLE payments ADD faildetail TEXT;"
msgstr ""
#: wallet/db.c:408
#: wallet/db.c:412
msgid "UPDATE payments SET faildetail = 'unspecified payment failure reason' WHERE status = 2;"
msgstr ""
#: wallet/db.c:413
#: wallet/db.c:417
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:429
#: wallet/db.c:433
msgid "DELETE FROM blocks WHERE height > (SELECT MIN(first_blocknum) FROM channels);"
msgstr ""
#: wallet/db.c:435
#: wallet/db.c:439
msgid "INSERT INTO blocks (height) VALUES ((SELECT MIN(first_blocknum) FROM channels)) ON CONFLICT(height) DO NOTHING;"
msgstr ""
#: wallet/db.c:439
#: wallet/db.c:443
msgid "DELETE FROM blocks WHERE height IS NULL;"
msgstr ""
#: wallet/db.c:441
#: wallet/db.c:445
msgid "ALTER TABLE invoices ADD description TEXT;"
msgstr ""
#: wallet/db.c:443
#: wallet/db.c:447
msgid "ALTER TABLE payments ADD description TEXT;"
msgstr ""
#: wallet/db.c:445
#: wallet/db.c:449
msgid "ALTER TABLE channels ADD future_per_commitment_point BLOB;"
msgstr ""
#: wallet/db.c:447
#: wallet/db.c:451
msgid "ALTER TABLE channels ADD last_sent_commit BLOB;"
msgstr ""
#: wallet/db.c:452
#: wallet/db.c:456
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:464
#: wallet/db.c:468
msgid "ALTER TABLE payments ADD faildirection INTEGER;"
msgstr ""
#: wallet/db.c:469
#: wallet/db.c:473
msgid "ALTER TABLE outputs ADD scriptpubkey BLOB;"
msgstr ""
#: wallet/db.c:471
#: wallet/db.c:475
msgid "ALTER TABLE payments ADD bolt11 TEXT;"
msgstr ""
#: wallet/db.c:473
#: wallet/db.c:477
msgid "ALTER TABLE channels ADD feerate_base INTEGER;"
msgstr ""
#: wallet/db.c:474
#: wallet/db.c:478
msgid "ALTER TABLE channels ADD feerate_ppm INTEGER;"
msgstr ""
#: wallet/db.c:476
#: wallet/db.c:480
msgid "ALTER TABLE channel_htlcs ADD received_time BIGINT"
msgstr ""
#: wallet/db.c:477
#: wallet/db.c:481
msgid "ALTER TABLE forwarded_payments ADD received_time BIGINT"
msgstr ""
#: wallet/db.c:478
#: wallet/db.c:482
msgid "ALTER TABLE forwarded_payments ADD resolved_time BIGINT"
msgstr ""
#: wallet/db.c:479
#: wallet/db.c:483
msgid "ALTER TABLE channels ADD remote_upfront_shutdown_script BLOB;"
msgstr ""
#: wallet/db.c:482
#: wallet/db.c:486
msgid "ALTER TABLE forwarded_payments ADD failcode INTEGER;"
msgstr ""
#: wallet/db.c:484
#: wallet/db.c:488
msgid "ALTER TABLE channels ADD remote_ann_node_sig BLOB;"
msgstr ""
#: wallet/db.c:485
#: wallet/db.c:489
msgid "ALTER TABLE channels ADD remote_ann_bitcoin_sig BLOB;"
msgstr ""
#: wallet/db.c:487
#: wallet/db.c:491
msgid "ALTER TABLE transactions ADD type BIGINT;"
msgstr ""
#: wallet/db.c:492
#: wallet/db.c:496
msgid "ALTER TABLE transactions ADD channel_id BIGINT;"
msgstr ""
#: wallet/db.c:494
#: wallet/db.c:498
msgid "UPDATE channels SET short_channel_id = REPLACE(short_channel_id, ':', 'x') WHERE short_channel_id IS NOT NULL;"
msgstr ""
#: wallet/db.c:497
#: wallet/db.c:501
msgid "UPDATE payments SET failchannel = REPLACE(failchannel, ':', 'x') WHERE failchannel IS NOT NULL;"
msgstr ""
#: wallet/db.c:500
#: wallet/db.c:504
msgid "ALTER TABLE channels ADD COLUMN option_static_remotekey INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:502
#: wallet/db.c:506
msgid "ALTER TABLE vars ADD COLUMN intval INTEGER"
msgstr ""
#: wallet/db.c:503
#: wallet/db.c:507
msgid "ALTER TABLE vars ADD COLUMN blobval BLOB"
msgstr ""
#: wallet/db.c:504
#: wallet/db.c:508
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:505
#: wallet/db.c:509
msgid "UPDATE vars SET blobval = CAST(val AS BLOB) WHERE name = 'genesis_hash'"
msgstr ""
#: wallet/db.c:506
#: wallet/db.c:510
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:518
#: wallet/db.c:522
msgid "ALTER TABLE channels ADD shutdown_scriptpubkey_local BLOB;"
msgstr ""
#: wallet/db.c:521
#: wallet/db.c:525
msgid "UPDATE forwarded_payments SET received_time=0 WHERE received_time IS NULL;"
msgstr ""
#: wallet/db.c:523
#: wallet/db.c:527
msgid "ALTER TABLE invoices ADD COLUMN features BLOB DEFAULT '';"
msgstr ""
#: wallet/db.c:527
#: wallet/db.c:531
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:554
#: wallet/db.c:558
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:599
#: wallet/db.c:603
msgid "UPDATE payments SET total_msat = msatoshi;"
msgstr ""
#: wallet/db.c:600
#: wallet/db.c:604
msgid "UPDATE payments SET partid = 0;"
msgstr ""
#: wallet/db.c:602
#: wallet/db.c:606
msgid "ALTER TABLE channel_htlcs ADD partid BIGINT;"
msgstr ""
#: wallet/db.c:603
#: wallet/db.c:607
msgid "UPDATE channel_htlcs SET partid = 0;"
msgstr ""
#: wallet/db.c:604
#: wallet/db.c:608
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:615
#: wallet/db.c:619
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:619
#: wallet/db.c:623
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:624
#: wallet/db.c:628
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:628
#: wallet/db.c:632
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:632
#: wallet/db.c:636
msgid "INSERT INTO vars (name, intval) VALUES ('data_version', 0);"
msgstr ""
#: wallet/db.c:635
#: wallet/db.c:639
msgid "ALTER TABLE channel_htlcs ADD localfailmsg BLOB;"
msgstr ""
#: wallet/db.c:636
#: wallet/db.c:640
msgid "UPDATE channel_htlcs SET localfailmsg=decode('2002', 'hex') WHERE malformed_onion != 0 AND direction = 1;"
msgstr ""
#: wallet/db.c:637
#: wallet/db.c:641
msgid "ALTER TABLE channels ADD our_funding_satoshi BIGINT DEFAULT 0;"
msgstr ""
#: wallet/db.c:638
#: wallet/db.c:642
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:648
#: wallet/db.c:652
msgid "ALTER TABLE channel_htlcs ADD we_filled INTEGER;"
msgstr ""
#: wallet/db.c:650
#: wallet/db.c:654
msgid "INSERT INTO vars (name, intval) VALUES ('coin_moves_count', 0);"
msgstr ""
#: wallet/db.c:652
#: wallet/db.c:656
msgid "ALTER TABLE outputs ADD reserved_til INTEGER DEFAULT NULL;"
msgstr ""
#: wallet/db.c:655
#: wallet/db.c:659
msgid "ALTER TABLE channels ADD COLUMN option_anchor_outputs INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:658
#: wallet/db.c:662
msgid "ALTER TABLE outputs ADD option_anchor_outputs INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:660
#: wallet/db.c:664
msgid "ALTER TABLE channels ADD full_channel_id BLOB DEFAULT NULL;"
msgstr ""
#: wallet/db.c:661
#: wallet/db.c:665
msgid "ALTER TABLE channels ADD funding_psbt BLOB DEFAULT NULL;"
msgstr ""
#: wallet/db.c:663
#: wallet/db.c:667
msgid "ALTER TABLE channels ADD closer INTEGER DEFAULT 2;"
msgstr ""
#: wallet/db.c:664
#: wallet/db.c:668
msgid "ALTER TABLE channels ADD state_change_reason INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:665
#: wallet/db.c:669
msgid "CREATE TABLE channel_state_changes ( channel_id BIGINT REFERENCES channels(id) ON DELETE CASCADE, timestamp BIGINT, old_state INTEGER, new_state INTEGER, cause INTEGER, message TEXT);"
msgstr ""
#: wallet/db.c:673
#: wallet/db.c:677
msgid "CREATE TABLE offers ( offer_id BLOB, bolt12 TEXT, label TEXT, status INTEGER, PRIMARY KEY (offer_id));"
msgstr ""
#: wallet/db.c:681
#: wallet/db.c:685
msgid "ALTER TABLE invoices ADD COLUMN local_offer_id BLOB DEFAULT NULL REFERENCES offers(offer_id);"
msgstr ""
#: wallet/db.c:683
#: wallet/db.c:687
msgid "ALTER TABLE payments ADD COLUMN local_offer_id BLOB DEFAULT NULL REFERENCES offers(offer_id);"
msgstr ""
#: wallet/db.c:684
#: wallet/db.c:688
msgid "ALTER TABLE channels ADD funding_tx_remote_sigs_received INTEGER DEFAULT 0;"
msgstr ""
#: wallet/db.c:687
#: wallet/db.c:691
msgid "CREATE INDEX forwarded_payments_out_htlc_id ON forwarded_payments (out_htlc_id);"
msgstr ""
#: wallet/db.c:689
#: wallet/db.c:693
msgid "UPDATE channel_htlcs SET malformed_onion = 0 WHERE malformed_onion IS NULL"
msgstr ""
#: wallet/db.c:691
#: wallet/db.c:695
msgid "CREATE INDEX forwarded_payments_state ON forwarded_payments (state)"
msgstr ""
#: wallet/db.c:692
#: wallet/db.c:696
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:706
#: wallet/db.c:710
msgid "ALTER TABLE channels ADD revocation_basepoint_local BLOB"
msgstr ""
#: wallet/db.c:707
#: wallet/db.c:711
msgid "ALTER TABLE channels ADD payment_basepoint_local BLOB"
msgstr ""
#: wallet/db.c:708
#: wallet/db.c:712
msgid "ALTER TABLE channels ADD htlc_basepoint_local BLOB"
msgstr ""
#: wallet/db.c:709
#: wallet/db.c:713
msgid "ALTER TABLE channels ADD delayed_payment_basepoint_local BLOB"
msgstr ""
#: wallet/db.c:710
#: wallet/db.c:714
msgid "ALTER TABLE channels ADD funding_pubkey_local BLOB"
msgstr ""
#: wallet/db.c:713
#: wallet/db.c:717
msgid "ALTER TABLE channels ADD shutdown_wrong_txid BLOB DEFAULT NULL"
msgstr ""
#: wallet/db.c:714
#: wallet/db.c:718
msgid "ALTER TABLE channels ADD shutdown_wrong_outnum INTEGER DEFAULT NULL"
msgstr ""
#: wallet/db.c:941
#: wallet/db.c:946
msgid "UPDATE vars SET intval = intval + 1 WHERE name = 'data_version' AND intval = ?"
msgstr ""
#: wallet/db.c:1041
#: wallet/db.c:1046
msgid "SELECT version FROM version LIMIT 1"
msgstr ""
#: wallet/db.c:1103
#: wallet/db.c:1108
msgid "UPDATE version SET version=?;"
msgstr ""
#: wallet/db.c:1111
#: wallet/db.c:1116
msgid "INSERT INTO db_upgrades VALUES (?, ?);"
msgstr ""
#: wallet/db.c:1123
#: wallet/db.c:1128
msgid "SELECT intval FROM vars WHERE name = 'data_version'"
msgstr ""
#: wallet/db.c:1150
#: wallet/db.c:1155
msgid "SELECT intval FROM vars WHERE name= ? LIMIT 1"
msgstr ""
#: wallet/db.c:1166
#: wallet/db.c:1171
msgid "UPDATE vars SET intval=? WHERE name=?;"
msgstr ""
#: wallet/db.c:1175
#: wallet/db.c:1180
msgid "INSERT INTO vars (name, intval) VALUES (?, ?);"
msgstr ""
#: wallet/db.c:1189
#: wallet/db.c:1194
msgid "UPDATE channels SET feerate_base = ?, feerate_ppm = ?;"
msgstr ""
#: wallet/db.c:1210
#: wallet/db.c:1215
msgid "UPDATE channels SET our_funding_satoshi = funding_satoshi WHERE funder = 0;"
msgstr ""
#: wallet/db.c:1226
#: wallet/db.c:1231
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:1288
#: wallet/db.c:1293
msgid "UPDATE outputs SET scriptpubkey = ? WHERE prev_out_tx = ? AND prev_out_index = ?"
msgstr ""
#: wallet/db.c:1313
#: wallet/db.c:1318
msgid "SELECT id, funding_tx_id, funding_tx_outnum FROM channels;"
msgstr ""
#: wallet/db.c:1332
#: wallet/db.c:1337
msgid "UPDATE channels SET full_channel_id = ? WHERE id = ?;"
msgstr ""
#: wallet/db.c:1353
#: wallet/db.c:1358
msgid "SELECT channels.id, peers.node_id FROM channels JOIN peers ON (peers.id = channels.peer_id)"
msgstr ""
#: wallet/db.c:1386
#: wallet/db.c:1391
msgid "UPDATE channels SET revocation_basepoint_local = ?, payment_basepoint_local = ?, htlc_basepoint_local = ?, delayed_payment_basepoint_local = ?, funding_pubkey_local = ? WHERE id = ?;"
msgstr ""
#: wallet/db.c:1417
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;"
msgid "SELECT c.id, p.node_id, c.fundingkey_remote, inflight.last_tx, inflight.last_sig, inflight.funding_satoshi, inflight.funding_tx_id FROM channels c LEFT OUTER JOIN peers p ON p.id = c.peer_id LEFT OUTER JOIN channel_funding_inflights inflight ON c.id = inflight.channel_id WHERE inflight.last_tx IS NOT NULL;"
msgstr ""
#: wallet/db.c:1484
msgid "UPDATE channel_funding_inflights SET last_tx = ? WHERE channel_id = ? AND funding_tx_id = ?;"
msgstr ""
#: wallet/db.c:1508
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:1575
msgid "UPDATE channels SET last_tx = ? WHERE id = ?;"
msgstr ""
@ -1245,4 +1253,4 @@ msgstr ""
#: wallet/test/run-wallet.c:1642
msgid "INSERT INTO channels (id) VALUES (1);"
msgstr ""
# SHA256STAMP:a401d434b80144503f4fe7cd17ae777fc7d4c546e0f104973d29e5c46c887383
# SHA256STAMP:383f8fff6066f7be166c121b10d6f4325eea0e02124251e0ceb2ba288de7426c

View file

@ -969,7 +969,7 @@ void wallet_inflight_add(struct wallet *w, struct channel_inflight *inflight)
db_bind_amount_sat(stmt, 4, &inflight->funding->total_funds);
db_bind_amount_sat(stmt, 5, &inflight->funding->our_funds);
db_bind_psbt(stmt, 6, inflight->funding_psbt);
db_bind_tx(stmt, 7, inflight->last_tx->wtx);
db_bind_psbt(stmt, 7, inflight->last_tx->psbt);
db_bind_signature(stmt, 8, &inflight->last_sig.s);
db_exec_prepared_v2(stmt);
assert(!stmt->error);
@ -1024,7 +1024,7 @@ wallet_stmt2inflight(struct wallet *w, struct db_stmt *stmt,
funding_sat,
our_funding_sat,
db_column_psbt(tmpctx, stmt, 5),
db_column_tx(tmpctx, stmt, 6),
db_column_psbt_to_tx(tmpctx, stmt, 6),
last_sig);
/* Pull out the serialized tx-sigs-received-ness */