mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
les: add GetCheckpoint-- fix TestOdrGetBlockLes2 fail
This commit is contained in:
parent
e5efdebfdf
commit
0138f2f6ed
1 changed files with 5 additions and 0 deletions
|
|
@ -95,6 +95,11 @@ func updateCheckpointFromPeer(pm *ProtocolManager, peer *peer, ctx context.Conte
|
||||||
var peerHeadBlockNum = hbl.Number
|
var peerHeadBlockNum = hbl.Number
|
||||||
log.Debug("updateCheckpointFromPeer", "peerHeadBlockNum", peerHeadBlockNum)
|
log.Debug("updateCheckpointFromPeer", "peerHeadBlockNum", peerHeadBlockNum)
|
||||||
|
|
||||||
|
if peerHeadBlockNum+1 < light.ChtFrequency {
|
||||||
|
log.Info("Peer has no fully processed blocks, nothing to do")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var sectionIdx uint64 = ((peerHeadBlockNum + 1) / light.ChtFrequency) - 1
|
var sectionIdx uint64 = ((peerHeadBlockNum + 1) / light.ChtFrequency) - 1
|
||||||
log.Debug("Retrieving checkpoint with: ", "sectionIdx", sectionIdx)
|
log.Debug("Retrieving checkpoint with: ", "sectionIdx", sectionIdx)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue