From 3d0d238d6a83227cfa667cee5c77c8392c9651ff Mon Sep 17 00:00:00 2001 From: Aaron <76254323+huichiaotsou@users.noreply.github.com> Date: Mon, 19 Sep 2022 20:52:22 +0800 Subject: [PATCH] revert: revert "return 0 height inside GetLastBlockHeight if there are no blocks" (#78) ## Description fix #76 I forgot to remove this section of codes lol ## Checklist - [ ] Targeted PR against correct branch. - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Wrote unit tests. - [ ] Re-reviewed `Files changed` in the Github PR explorer. --- database/postgresql/postgresql.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/database/postgresql/postgresql.go b/database/postgresql/postgresql.go index 0b8f4fa8..6bf51c83 100644 --- a/database/postgresql/postgresql.go +++ b/database/postgresql/postgresql.go @@ -105,10 +105,6 @@ func (db *Database) GetLastBlockHeight() (int64, error) { return 0, fmt.Errorf("error while getting last block height, error: %s", err) } - if height == 0 { - return 0, fmt.Errorf("cannot get block height, no blocks saved") - } - return height, nil }