mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
p2p/rlpx: prefer returning new queued packets over errors
This fixes intermittent failures in the p2p tests.
This commit is contained in:
parent
e66ead8d86
commit
f296300509
1 changed files with 1 additions and 1 deletions
|
|
@ -332,7 +332,7 @@ func (p *Protocol) ReadPacket() (totalSize uint32, r io.Reader, err error) {
|
|||
for len(p.newPackets) == 0 && p.readErr == nil {
|
||||
p.readCond.Wait()
|
||||
}
|
||||
if p.readErr != nil {
|
||||
if len(p.newPackets) == 0 && p.readErr != nil {
|
||||
return 0, nil, p.readErr
|
||||
}
|
||||
pr := p.newPackets[0]
|
||||
|
|
|
|||
Loading…
Reference in a new issue