wallet: get first blocknum from any channels.

The previous tests didn't make sense anyway, but I think they were trying
to exclude onchain channels.

We delete completely forgotten channels anyway now, so we don't need
such testing.

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 661950e402
commit bab3b1a16b

View File

@ -628,8 +628,7 @@ u32 wallet_channels_first_blocknum(struct wallet *w)
u32 first_blocknum;
sqlite3_stmt *stmt =
db_query(__func__, w->db,
"SELECT MIN(first_blocknum) FROM channels WHERE state >= %d AND state != %d;",
OPENINGD, CLOSINGD_COMPLETE);
"SELECT MIN(first_blocknum) FROM channels;");
err = sqlite3_step(stmt);
if (err == SQLITE_ROW && sqlite3_column_type(stmt, 0) != SQLITE_NULL)