• Ferenc Szabo's avatar
    swarm/network: fix data race in stream.(*Peer).handleOfferedHashesMsg() (#18468) · 4f8ec445
    Ferenc Szabo authored
    * swarm/network: fix data race in stream.(*Peer).handleOfferedHashesMsg()
    
    handleOfferedHashesMsg() contained a data race:
    - read => in a goroutine, call to c.batchDone()
    - write => in the main thread, write to c.sessionAt
    
    c.batchDone() contained a call to c.AddInterval(). Client was a value
    receiver for AddInterval. So on c.AddInterval() call the whole client
    struct got copied (read) while one of its field was modified in
    handleOfferedHashesMsg() (write).
    
    fixes ethersphere/go-ethereum#1086
    
    * swarm/network: simplify some trivial statements
    4f8ec445
Name
Last commit
Last update
..
api Loading commit data...
bmt Loading commit data...
chunk Loading commit data...
dev Loading commit data...
docker Loading commit data...
fuse Loading commit data...
log Loading commit data...
metrics Loading commit data...
network Loading commit data...
pot Loading commit data...
pss Loading commit data...
sctx Loading commit data...
services/swap Loading commit data...
shed Loading commit data...
spancontext Loading commit data...
state Loading commit data...
storage Loading commit data...
swap Loading commit data...
testutil Loading commit data...
tracing Loading commit data...
version Loading commit data...
AUTHORS Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
network_test.go Loading commit data...
swarm.go Loading commit data...
swarm_test.go Loading commit data...