Skip to content

Commit

Permalink
fix:meerevm stream close error
Browse files Browse the repository at this point in the history
  • Loading branch information
lochjin committed Dec 23, 2024
1 parent 8294c10 commit 5b97800
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion p2p/synch/meerevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (s *Sync) establishMeerConnection(pe *peers.Peer) error {
if err != nil {
return common.NewErrorStr(common.ErrStreamBase, fmt.Sprintf("open stream on topic %v failed", topic)).ToError()
}
defer stream.Close()

common.EgressConnectMeter.Mark(1)
qc, err := NewMeerConn(stream)
Expand All @@ -62,6 +61,10 @@ func (s *Sync) establishMeerConnection(pe *peers.Peer) error {
log.Error(err.Error())
}
pe.SetMeerConn(false)
err = stream.Close()
if err != nil {
log.Error("Close meer conn", "err", err.Error())
}
}()
return err
}
Expand Down

0 comments on commit 5b97800

Please sign in to comment.