From aa7ffb78bd8d3dcd9f3d04f69a81b8b3403e76b5 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 19 Jul 2022 17:04:38 +0930 Subject: [PATCH] wallet: resolve crash when blockheight is null We weren't ignoring the 'txindex' field --- wallet/wallet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wallet/wallet.c b/wallet/wallet.c index aae846635..1c276c2e8 100644 --- a/wallet/wallet.c +++ b/wallet/wallet.c @@ -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");