Update tx_fetcher.go

This commit is contained in:
crStiv 2025-03-23 22:06:22 +01:00 committed by GitHub
parent b0b2b76509
commit 2eafd6b6e7
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.
func (f *TxFetcher) isKnownUnderpriced(hash common.Hash) bool {
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)
return false
}