core/rawdb: separate raw database access to own package (#16666)
This commit is contained in:
@ -20,7 +20,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core"
|
||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||
"github.com/ethereum/go-ethereum/eth/downloader"
|
||||
"github.com/ethereum/go-ethereum/light"
|
||||
)
|
||||
@ -56,7 +56,7 @@ func (pm *ProtocolManager) syncer() {
|
||||
|
||||
func (pm *ProtocolManager) needToSync(peerHead blockInfo) bool {
|
||||
head := pm.blockchain.CurrentHeader()
|
||||
currentTd := core.GetTd(pm.chainDb, head.Hash(), head.Number.Uint64())
|
||||
currentTd := rawdb.ReadTd(pm.chainDb, head.Hash(), head.Number.Uint64())
|
||||
return currentTd != nil && peerHead.Td.Cmp(currentTd) > 0
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user