From 7e1ec67df4554f8eab559267372a0b530db7df9d Mon Sep 17 00:00:00 2001 From: Jin Date: Fri, 12 May 2023 09:56:44 +0800 Subject: [PATCH] BUG:The block sync speed is relatively slow --- p2p/synch/getblockdatas.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/p2p/synch/getblockdatas.go b/p2p/synch/getblockdatas.go index 59f01201..be523645 100644 --- a/p2p/synch/getblockdatas.go +++ b/p2p/synch/getblockdatas.go @@ -159,8 +159,10 @@ func (ps *PeerSync) processGetBlockDatas(pe *peers.Peer, blocks []*hash.Hash) *P if err != nil { log.Warn(fmt.Sprintf("getBlocks send:%v", err), "processID", ps.processID) if index == 0 { + index++ return false } else { + index = readys return true } } @@ -190,6 +192,8 @@ func (ps *PeerSync) processGetBlockDatas(pe *peers.Peer, blocks []*hash.Hash) *P return true } } + } else { + index = readys } return true }