mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
added a maxTxArrivalWait constant to the fetcher. config params with longer durations than maxTxArrivalWait will default to the maxTxArrivalWait duration
This commit is contained in:
parent
070b13efbd
commit
a5b49c313f
1 changed files with 9 additions and 0 deletions
|
|
@ -56,6 +56,10 @@ const (
|
|||
// txGatherSlack is the interval used to collate almost-expired announces
|
||||
// with network fetches.
|
||||
txGatherSlack = 20 * time.Millisecond
|
||||
|
||||
// maxTxArrivalWait is the longest acceptable duration for the txArrivalWait
|
||||
// configuration value. Longer config values will default to this.
|
||||
maxTxArrivalWait = 500 * time.Millisecond
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -337,6 +341,11 @@ func (f *TxFetcher) Start() {
|
|||
f.txArrivalWait = txGatherSlack
|
||||
}
|
||||
|
||||
// the txArrivalWait duration should not be greater than the maxTxArrivalWait duration
|
||||
if f.txArrivalWait > maxTxArrivalWait {
|
||||
f.txArrivalWait = maxTxArrivalWait
|
||||
}
|
||||
|
||||
go f.loop()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue