wallet: fix logic for finding first block.

Over 20 years a professional C programmer, still can't count from zero!

Fixes: #709
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-25 21:33:50 +10:30 committed by Christian Decker
parent e66bd25b5c
commit 661950e402
1 changed files with 2 additions and 2 deletions

View File

@ -632,8 +632,8 @@ u32 wallet_channels_first_blocknum(struct wallet *w)
OPENINGD, CLOSINGD_COMPLETE);
err = sqlite3_step(stmt);
if (err == SQLITE_ROW && sqlite3_column_type(stmt, 1) != SQLITE_NULL)
first_blocknum = sqlite3_column_int(stmt, 1);
if (err == SQLITE_ROW && sqlite3_column_type(stmt, 0) != SQLITE_NULL)
first_blocknum = sqlite3_column_int(stmt, 0);
else
first_blocknum = UINT32_MAX;