diff --git a/core/lending_pool.go b/core/lending_pool.go index 26d7a1395a..292faeb10b 100644 --- a/core/lending_pool.go +++ b/core/lending_pool.go @@ -944,9 +944,10 @@ func (pool *LendingPool) removeTx(hash common.Hash) { // future queue to the set of pending transactions. During this process, all // invalidated transactions (low nonce, low balance) are deleted. func (pool *LendingPool) promoteExecutables(accounts []common.Address) { - start := time.Now() log.Debug("start promoteExecutables") - defer log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + defer func(start time.Time) { + log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + }(time.Now()) // Gather all the accounts potentially needing updates if accounts == nil { accounts = make([]common.Address, 0, len(pool.queue)) diff --git a/core/order_pool.go b/core/order_pool.go index 6b36f03050..ed275e1792 100644 --- a/core/order_pool.go +++ b/core/order_pool.go @@ -859,8 +859,10 @@ func (pool *OrderPool) removeTx(hash common.Hash) { // future queue to the set of pending transactions. During this process, all // invalidated transactions (low nonce, low balance) are deleted. func (pool *OrderPool) promoteExecutables(accounts []common.Address) { - start := time.Now() - defer log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + defer func(start time.Time) { + log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + }(time.Now()) + // Gather all the accounts potentially needing updates if accounts == nil { accounts = make([]common.Address, 0, len(pool.queue)) diff --git a/core/tx_pool.go b/core/tx_pool.go index 7866371827..2258ee4198 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -1045,9 +1045,11 @@ func (pool *TxPool) removeTx(hash common.Hash) { // future queue to the set of pending transactions. During this process, all // invalidated transactions (low nonce, low balance) are deleted. func (pool *TxPool) promoteExecutables(accounts []common.Address) { - start := time.Now() log.Debug("start promoteExecutables") - defer log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + defer func(start time.Time) { + log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start))) + }(time.Now()) + // Gather all the accounts potentially needing updates if accounts == nil { accounts = make([]common.Address, 0, len(pool.queue))