Skip to content

Commit

Permalink
BUG:legacychain database upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lochjin committed Oct 18, 2023
1 parent bde9231 commit cc3cfd2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions database/legacychaindb/legacychaindb_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ func (cdb *LegacyChainDB) TryUpgrade(di *common.DatabaseInfo, interrupt <-chan s
if system.InterruptRequested(interrupt) {
return fmt.Errorf("interrupt upgrade database")
}
blockid, err = cdb.GetBlockIdByOrder(uint(i))
if err != nil {
return err
}
err = cdb.db.View(func(dbTx legacydb.Tx) error {
blockhash, err = dbFetchBlockHashByIID(dbTx, i)
blockhash, err = dbFetchBlockHashByIID(dbTx, uint32(blockid))
return err
})
if err != nil {
Expand All @@ -78,10 +82,6 @@ func (cdb *LegacyChainDB) TryUpgrade(di *common.DatabaseInfo, interrupt <-chan s
if err != nil {
return err
}
blockid, err = cdb.GetDAGBlockIdByHash(blockhash)
if err != nil {
return err
}
dblock := &meerdag.Block{}
dblock.SetID(blockid)
ib := &meerdag.PhantomBlock{Block: dblock}
Expand Down

0 comments on commit cc3cfd2

Please sign in to comment.