mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Merge pull request #346 from gzliudan/defer-time.Since
call to time.Since is not deferred
This commit is contained in:
commit
f7025cee2f
3 changed files with 11 additions and 6 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue