mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 12:16:44 +00:00
Fix delete of element in pending slice
This commit is contained in:
parent
2c3a014f03
commit
9c1b43f813
1 changed files with 1 additions and 3 deletions
|
|
@ -256,9 +256,7 @@ func (t *udp) loop() {
|
|||
for i, p := range pending {
|
||||
if reply.from == p.from && reply.ptype == p.ptype && p.callback(reply.data) {
|
||||
p.errc <- nil
|
||||
copy(pending[i:], pending[i+1:])
|
||||
pending = pending[:len(pending)-1]
|
||||
i--
|
||||
pending = append(pending[:i], pending[i+1:]...)
|
||||
}
|
||||
}
|
||||
rearmTimeout()
|
||||
|
|
|
|||
Loading…
Reference in a new issue