mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
bkpr-recorder: fatal if there's an error with a database statement
We were silently failing when NULLS FIRST wasn't found on older boxes (running sqlite3 < v3.30.1)
This commit is contained in:
@@ -72,6 +72,8 @@ static struct chain_event **find_chain_events(const tal_t *ctx,
|
||||
struct chain_event **results;
|
||||
|
||||
db_query_prepared(stmt);
|
||||
if (stmt->error)
|
||||
db_fatal("find_chain_events err: %s", stmt->error);
|
||||
results = tal_arr(ctx, struct chain_event *, 0);
|
||||
while (db_step(stmt)) {
|
||||
struct chain_event *e = stmt2chain_event(results, stmt);
|
||||
|
||||
@@ -697,6 +697,7 @@ static bool test_onchain_fee_chan_close(const tal_t *ctx, struct plugin *p)
|
||||
CHECK(acct->onchain_resolved_block == 0);
|
||||
db_begin_transaction(db);
|
||||
maybe_mark_account_onchain(db, acct);
|
||||
CHECK_MSG(!db_err, db_err);
|
||||
CHECK(acct->onchain_resolved_block == blockheight + 2);
|
||||
err = update_channel_onchain_fees(ctx, db, acct);
|
||||
CHECK_MSG(!err, err);
|
||||
|
||||
Reference in New Issue
Block a user