mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16: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 //
|
req *requestStatus //
|
||||||
wg *sync.WaitGroup
|
wg *sync.WaitGroup
|
||||||
dbStored chan bool
|
dbStored chan bool
|
||||||
source peer
|
source *peer
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChunkStore interface {
|
type ChunkStore interface {
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ func (self *NetStore) addStoreRequest(req *storeRequestMsgData) {
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
chunk.source = req.peer
|
chunk.source = &req.peer
|
||||||
self.put(chunk)
|
self.put(chunk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,7 +295,7 @@ func (self *NetStore) store(chunk *Chunk) {
|
||||||
Id: uint64(id),
|
Id: uint64(id),
|
||||||
}
|
}
|
||||||
for _, peer := range self.hive.getPeers(chunk.Key, 0) {
|
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)
|
go peer.store(req)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,11 +468,7 @@ func (s *Ethereum) Start() error {
|
||||||
|
|
||||||
if s.DPA != nil {
|
if s.DPA != nil {
|
||||||
s.DPA.Start()
|
s.DPA.Start()
|
||||||
selfNode := s.net.Self()
|
s.netStore.Start(s.net.Self())
|
||||||
if selfNode == nil {
|
|
||||||
panic("self is nil")
|
|
||||||
}
|
|
||||||
s.netStore.Start(selfNode)
|
|
||||||
go bzz.StartHttpServer(s.DPA)
|
go bzz.StartHttpServer(s.DPA)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue