mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
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:
16
wallet/db_postgres_sqlgen.c
generated
16
wallet/db_postgres_sqlgen.c
generated
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user