Commit 53988d7 yxq
committed
1 parent 4dad050 commit 53988d7 Copy full SHA for 53988d7
File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func (p *Protocol) initLocalChunkInfoMap() {
120
120
start := time .Now ()
121
121
records , err := p .getChunkRecordFromBlockchain (& types.ReqChunkRecords {Start : 0 , End : 0 })
122
122
if err != nil {
123
- panic ( err )
123
+ return
124
124
}
125
125
if records == nil || len (records .Infos ) != 1 {
126
126
panic ("invalid record" )
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ func CloseStream(stream network.Stream) {
52
52
return
53
53
}
54
54
_ = stream .CloseWrite ()
55
+ _ = stream .CloseRead ()
55
56
go func () {
56
57
err := AwaitEOF (stream )
57
58
if err != nil {
@@ -349,5 +350,5 @@ func AwaitEOF(s network.Stream) error {
349
350
_ = s .Reset ()
350
351
return err
351
352
}
352
- return nil
353
+ return s . Close ()
353
354
}
You can’t perform that action at this time.
0 commit comments