mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
only send on genuine storage requests with netStore.store, not deliveries
This commit is contained in:
parent
38fc79129f
commit
26c7023120
2 changed files with 6 additions and 3 deletions
|
|
@ -88,13 +88,12 @@ func (self *NetStore) Put(entry *Chunk) {
|
|||
func (self *NetStore) put(entry *Chunk) {
|
||||
self.localStore.Put(entry)
|
||||
dpaLogger.Debugf("NetStore.put: localStore.Put of %064x completed, %d bytes (%p).", entry.Key, len(entry.SData), entry)
|
||||
go self.store(entry)
|
||||
// only send responses once
|
||||
dpaLogger.Debugf("NetStore.put: req: %#v", entry.req)
|
||||
if entry.req != nil && entry.req.status == reqSearching {
|
||||
entry.req.status = reqFound
|
||||
close(entry.req.C)
|
||||
self.propagateResponse(entry)
|
||||
} else {
|
||||
go self.store(entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ type storeRequestMsgData struct {
|
|||
peer peer
|
||||
}
|
||||
|
||||
func (self *storeRequestMsgData) String() string {
|
||||
return fmt.Sprint("From: %v, Key: %x; ID: %v, requestTimeout: %v, storageTimeout: %v, SData %x", self.peer.Addr(), self.Key[:4], self.Id, self.requestTimeout, self.storageTimeout, self.SData[:10])
|
||||
}
|
||||
|
||||
/*
|
||||
Root key retrieve request
|
||||
Timeout in milliseconds. Note that zero timeout retrieval requests do not request forwarding, but prompt for a peers message response. therefore they also serve also as messages to retrieve peers.
|
||||
|
|
|
|||
Loading…
Reference in a new issue