mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fixup
This commit is contained in:
parent
4c5556591e
commit
ecaaa1231a
2 changed files with 5 additions and 6 deletions
|
|
@ -30,7 +30,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
defaultSearchTimeout = 4 * time.Second
|
||||
defaultSearchTimeout = 1 * time.Second
|
||||
// maximum number of forwarded requests (hops), to make sure requests are not
|
||||
// forwarded forever in peer loops
|
||||
maxHopCount uint8 = 20
|
||||
|
|
@ -38,7 +38,7 @@ const (
|
|||
|
||||
// Time to consider peer to be skipped.
|
||||
// Also used in stream delivery.
|
||||
var RequestTimeout = 15 * time.Second
|
||||
var RequestTimeout = 10 * time.Second
|
||||
|
||||
type RequestFunc func(context.Context, *Request) (*enode.ID, chan struct{}, error)
|
||||
|
||||
|
|
@ -272,7 +272,6 @@ func (f *Fetcher) run(peers *sync.Map) {
|
|||
// * the peer's address is removed from prospective sources, and
|
||||
// * a go routine is started that reports on the gone channel if the peer is disconnected (or terminated their streamer)
|
||||
func (f *Fetcher) doRequest(gone chan *enode.ID, peersToSkip *sync.Map, sources []*enode.ID, hopCount uint8) ([]*enode.ID, error) {
|
||||
|
||||
var i int
|
||||
var sourceID *enode.ID
|
||||
var quit chan struct{}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ func (n *NetStore) Put(ctx context.Context, ch Chunk) error {
|
|||
|
||||
// if chunk is now put in the store, check if there was an active fetcher and call deliver on it
|
||||
// (this delivers the chunk to requestors via the fetcher)
|
||||
log.Debug("n.getFetcher", "ref", ch.Address())
|
||||
log.Trace("n.getFetcher", "ref", ch.Address())
|
||||
if f := n.getFetcher(ch.Address()); f != nil {
|
||||
log.Debug("n.getFetcher deliver", "ref", ch.Address())
|
||||
log.Trace("n.getFetcher deliver", "ref", ch.Address())
|
||||
f.deliver(ctx, ch)
|
||||
}
|
||||
return nil
|
||||
|
|
@ -343,6 +343,6 @@ func (f *fetcher) deliver(ctx context.Context, ch Chunk) {
|
|||
f.chunk = ch
|
||||
// closing the deliveredC channel will terminate ongoing requests
|
||||
close(f.deliveredC)
|
||||
log.Debug("n.getFetcher close deliveredC", "ref", ch.Address())
|
||||
log.Trace("n.getFetcher close deliveredC", "ref", ch.Address())
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue