Skip to content

Commit eeefc56

Browse files
committed
fix: p2p simulation bug
1 parent a465932 commit eeefc56

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

p2p/node.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ func (n *p2pNode) eachRun(network *Network, wg *sync.WaitGroup, ctx context.Cont
5151
n.alive = true
5252
wg.Done()
5353

54-
for msg := range n.msgQueue {
55-
select {
56-
case <-ctx.Done():
57-
n.alive = false
58-
return
59-
default:
54+
select {
55+
case <-ctx.Done():
56+
n.alive = false
57+
return
58+
default:
59+
for msg := range n.msgQueue {
6060
first := false
6161

6262
n.mu.Lock()

0 commit comments

Comments
 (0)