mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
db: Switch to indirect db_last_insert_id
version
We are about to delete all the `sqlite3`-specific code from `db.c` and this is one of the last uses of the old interface. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
742bcdb2bc
commit
ec8efe02e1
@ -304,8 +304,7 @@ bool invoices_create(struct invoices *invoices,
|
|||||||
|
|
||||||
db_exec_prepared_v2(stmt);
|
db_exec_prepared_v2(stmt);
|
||||||
|
|
||||||
pinvoice->id = db_last_insert_id(invoices->db);
|
pinvoice->id = db_last_insert_id_v2(take(stmt));
|
||||||
tal_free(stmt);
|
|
||||||
|
|
||||||
/* Install expiration trigger. */
|
/* Install expiration trigger. */
|
||||||
if (!invoices->expiration_timer ||
|
if (!invoices->expiration_timer ||
|
||||||
|
@ -1353,8 +1353,8 @@ void wallet_channel_insert(struct wallet *w, struct channel *chan)
|
|||||||
db_bind_text(stmt, 1,
|
db_bind_text(stmt, 1,
|
||||||
type_to_string(tmpctx, struct wireaddr_internal,
|
type_to_string(tmpctx, struct wireaddr_internal,
|
||||||
&chan->peer->addr));
|
&chan->peer->addr));
|
||||||
db_exec_prepared_v2(take(stmt));
|
db_exec_prepared_v2(stmt);
|
||||||
chan->peer->dbid = db_last_insert_id(w->db);
|
chan->peer->dbid = db_last_insert_id_v2(take(stmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert a stub, that we update, unifies INSERT and UPDATE paths */
|
/* Insert a stub, that we update, unifies INSERT and UPDATE paths */
|
||||||
@ -1567,8 +1567,8 @@ void wallet_htlc_save_in(struct wallet *wallet,
|
|||||||
|
|
||||||
db_bind_timeabs(stmt, 10, in->received_time);
|
db_bind_timeabs(stmt, 10, in->received_time);
|
||||||
|
|
||||||
db_exec_prepared_v2(take(stmt));
|
db_exec_prepared_v2(stmt);
|
||||||
in->dbid = db_last_insert_id(wallet->db);
|
in->dbid = db_last_insert_id_v2(take(stmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
void wallet_htlc_save_out(struct wallet *wallet,
|
void wallet_htlc_save_out(struct wallet *wallet,
|
||||||
|
Loading…
Reference in New Issue
Block a user