wallet: resolve crash when blockheight is null

We weren't ignoring the 'txindex' field
This commit is contained in:
niftynei 2022-07-19 17:04:38 +09:30 committed by Rusty Russell
parent 4326c08927
commit aa7ffb78bd
1 changed files with 3 additions and 2 deletions

View File

@ -4197,9 +4197,10 @@ struct txlocator *wallet_transaction_locate(const tal_t *ctx, struct wallet *w,
return NULL;
}
if (db_col_is_null(stmt, "blockheight"))
if (db_col_is_null(stmt, "blockheight")) {
db_col_ignore(stmt, "txindex");
loc = NULL;
else {
} else {
loc = tal(ctx, struct txlocator);
loc->blkheight = db_col_int(stmt, "blockheight");
loc->index = db_col_int(stmt, "txindex");