Update tx_fetcher.go

This commit is contained in:
crStiv 2025-03-23 22:08:48 +01:00 committed by GitHub
parent bfa1c0a484
commit c89fd5264a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,7 +293,8 @@ func (f *TxFetcher) Notify(peer string, types []byte, sizes []uint32, hashes []c
// isKnownUnderpriced reports whether a transaction hash was recently found to be underpriced. // isKnownUnderpriced reports whether a transaction hash was recently found to be underpriced.
func (f *TxFetcher) isKnownUnderpriced(hash common.Hash) bool { func (f *TxFetcher) isKnownUnderpriced(hash common.Hash) bool {
prevTime, ok := f.underpriced.Peek(hash) prevTime, ok := f.underpriced.Peek(hash)
if ok && prevTime.Before(time.Now().Add(-maxTxUnderpricedTimeout)) { now := time.Unix(int64(f.clock.Now()/1000000000), 0)
if ok && prevTime.Before(now.Add(-maxTxUnderpricedTimeout)) {
f.underpriced.Remove(hash) f.underpriced.Remove(hash)
return false return false
} }