Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
661950e402
  1. 4
      wallet/wallet.c

4
wallet/wallet.c

@ -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;

Loading…
Cancel
Save