mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
db: make db_exec_prepared_v2 return void.
It calls db_fatal() if it fails anyway, so don't expect anyone to check. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -64,8 +64,7 @@ void db_set_intvar(struct db *db, char *varname, s64 val)
|
||||
struct db_stmt *stmt = db_prepare_v2(db, SQL("UPDATE vars SET intval=? WHERE name=?;"));
|
||||
db_bind_int(stmt, 0, val);
|
||||
db_bind_text(stmt, 1, varname);
|
||||
if (!db_exec_prepared_v2(stmt))
|
||||
db_fatal("Error executing update: %s", stmt->error);
|
||||
db_exec_prepared_v2(stmt);
|
||||
changes = db_count_changes(stmt);
|
||||
tal_free(stmt);
|
||||
|
||||
@@ -73,8 +72,7 @@ void db_set_intvar(struct db *db, char *varname, s64 val)
|
||||
stmt = db_prepare_v2(db, SQL("INSERT INTO vars (name, intval) VALUES (?, ?);"));
|
||||
db_bind_text(stmt, 0, varname);
|
||||
db_bind_int(stmt, 1, val);
|
||||
if (!db_exec_prepared_v2(stmt))
|
||||
db_fatal("Error executing insert: %s", stmt->error);
|
||||
db_exec_prepared_v2(stmt);
|
||||
tal_free(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user