From 47ee58bc9fde394b8bc8ac0e2c82131276181187 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Tue, 30 Aug 2022 12:01:04 -0600 Subject: [PATCH] fast-exist FindRetentionBound --- core/blockchain_arbitrum.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/blockchain_arbitrum.go b/core/blockchain_arbitrum.go index d46a2eff9b..2709b8ae39 100644 --- a/core/blockchain_arbitrum.go +++ b/core/blockchain_arbitrum.go @@ -73,6 +73,10 @@ func (bc *BlockChain) FindRetentionBound() uint64 { minimumSpan := bc.cacheConfig.TriesInMemory minimumAge := uint64(bc.cacheConfig.TrieRetention.Seconds()) + if minimumAge == 0 { + return minimumSpan + } + saturatingCast := func(value int64) uint64 { if value < 0 { return 0