Skip to content

Commit 0e67b7e

Browse files
committed
BUG:panic about conSyncDAGHandler
1 parent 54a0ee6 commit 0e67b7e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

p2p/synch/syncdag.go

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func (s *Sync) conSyncDAGHandler(ctx context.Context, msg interface{}, stream li
6161

6262
gs := pe.GraphState()
6363
blocks, point := s.PeerSync().dagSync.CalcSyncBlocks(gs, []*hash.Hash{changePBHashToHash(m.SyncPoint), changePBHashToHash(m.Start)}, meerdag.ContinueMode, MaxBlockLocatorsPerMsg)
64+
if point == nil || len(blocks) <= 0 {
65+
err := fmt.Errorf("CalcSyncBlocks error by ContinueMode: point=%s start=%s", m.SyncPoint.String(), m.Start.String())
66+
return ErrMessage(err)
67+
}
6468
pe.UpdateSyncPoint(point)
6569
sd := &pb.SubDAG{SyncPoint: &pb.Hash{Hash: point.Bytes()}, GraphState: s.getGraphState(), Blocks: changeHashsToPBHashs(blocks)}
6670

0 commit comments

Comments
 (0)