From 0f9e3d278538b650439134d8b3b3638ea390b4cf Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 11:21:03 -0600 Subject: [PATCH] Revert "p2p/simulations/examples: use atomic.Int64 (#27861)" This reverts commit 7b3e2ee58804d418dfd2da08db61f918bccb0404. --- p2p/simulations/examples/ping-pong.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/simulations/examples/ping-pong.go b/p2p/simulations/examples/ping-pong.go index f6cf5113a6ee4..d9b51dc09bb06 100644 --- a/p2p/simulations/examples/ping-pong.go +++ b/p2p/simulations/examples/ping-pong.go @@ -91,7 +91,7 @@ func main() { type pingPongService struct { id enode.ID log log.Logger - received atomic.Int64 + received int64 } func newPingPongService(id enode.ID) *pingPongService { @@ -125,7 +125,7 @@ func (p *pingPongService) Info() interface{} { return struct { Received int64 `json:"received"` }{ - p.received.Load(), + atomic.LoadInt64(&p.received), } } @@ -162,7 +162,7 @@ func (p *pingPongService) Run(peer *p2p.Peer, rw p2p.MsgReadWriter) error { return } log.Info("received message", "msg.code", msg.Code, "msg.payload", string(payload)) - p.received.Add(1) + atomic.AddInt64(&p.received, 1) if msg.Code == pingMsgCode { log.Info("sending pong") go p2p.Send(rw, pongMsgCode, "PONG")