mirror of https://github.com/ethereum/go-ethereum
swarm/network: fix data race in stream.(*Peer).handleOfferedHashesMsg() (#18468)
* 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 statementspull/18447/head
parent
81e26d5a48
commit
4f8ec44565
Loading…
Reference in new issue