mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
fix nil source on chunk
This commit is contained in:
parent
e2887da4c4
commit
46aa7db5fd
3 changed files with 4 additions and 8 deletions
|
|
@ -61,7 +61,7 @@ type Chunk struct {
|
|||
req *requestStatus //
|
||||
wg *sync.WaitGroup
|
||||
dbStored chan bool
|
||||
source peer
|
||||
source *peer
|
||||
}
|
||||
|
||||
type ChunkStore interface {
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ func (self *NetStore) addStoreRequest(req *storeRequestMsgData) {
|
|||
} else {
|
||||
return
|
||||
}
|
||||
chunk.source = req.peer
|
||||
chunk.source = &req.peer
|
||||
self.put(chunk)
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ func (self *NetStore) store(chunk *Chunk) {
|
|||
Id: uint64(id),
|
||||
}
|
||||
for _, peer := range self.hive.getPeers(chunk.Key, 0) {
|
||||
if peer.Addr() != chunk.source.Addr() {
|
||||
if chunk.source == nil || peer.Addr() != chunk.source.Addr() {
|
||||
go peer.store(req)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -468,11 +468,7 @@ func (s *Ethereum) Start() error {
|
|||
|
||||
if s.DPA != nil {
|
||||
s.DPA.Start()
|
||||
selfNode := s.net.Self()
|
||||
if selfNode == nil {
|
||||
panic("self is nil")
|
||||
}
|
||||
s.netStore.Start(selfNode)
|
||||
s.netStore.Start(s.net.Self())
|
||||
go bzz.StartHttpServer(s.DPA)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue