Skip to content

Commit

Permalink
fix: get earliest verfied block
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryTong65 committed Jul 18, 2024
1 parent bef0c27 commit b7e473d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (d *BlockSvcDB) GetEarliestUnverifiedBlock() (*Block, error) {

func (d *BlockSvcDB) GetEarliestVerifiedBlock() (*Block, error) {
block := Block{}
err := d.db.Model(Block{}).Where("status = ?", Verified).Order("block_number asc").Take(&block).Error
err := d.db.Model(Block{}).Where("status = ?", Verified).Order("block_number desc").Take(&block).Error
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b7e473d

Please sign in to comment.