Skip to content

Commit 1a5b5be

Browse files
yxq33cn
yxq
authored andcommitted
fix: fetch chunk routine bug
1 parent c0939d1 commit 1a5b5be

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

blockchain/blockstore.go

-1
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,6 @@ func (bs *BlockStore) deleteRecvChunkHash(num int64) error {
17191719
func (bs *BlockStore) getRecvChunkHash(chunkNum int64) ([]byte, error) {
17201720
value, err := bs.GetKey(calcRecvChunkNumToHash(chunkNum))
17211721
if err != nil {
1722-
storeLog.Error("getRecvChunkHash", "chunkNum", chunkNum, "error", err)
17231722
return nil, err
17241723
}
17251724
var chunk types.ChunkInfo

blockchain/blocksyn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ func (chain *BlockChain) FetchChunkBlockRoutine() {
12031203
_, safetyStart, safetyEnd := chain.CalcSafetyChunkInfo(chain.GetPeerMaxBlkHeight())
12041204
if chunkStart > safetyEnd {
12051205
if chain.GetBlockHeight() > safetyStart {
1206-
break
1206+
return
12071207
}
12081208
// 执行速度跟不上下载速度,此时不能直接退出,可能执行一段时间后又有新的chunk需要下载
12091209
time.Sleep(time.Second * 5)

0 commit comments

Comments
 (0)