mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-11 07:24:27 +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
|
// future queue to the set of pending transactions. During this process, all
|
||||||
// invalidated transactions (low nonce, low balance) are deleted.
|
// invalidated transactions (low nonce, low balance) are deleted.
|
||||||
func (pool *LendingPool) promoteExecutables(accounts []common.Address) {
|
func (pool *LendingPool) promoteExecutables(accounts []common.Address) {
|
||||||
start := time.Now()
|
|
||||||
log.Debug("start promoteExecutables")
|
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
|
// Gather all the accounts potentially needing updates
|
||||||
if accounts == nil {
|
if accounts == nil {
|
||||||
accounts = make([]common.Address, 0, len(pool.queue))
|
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
|
// future queue to the set of pending transactions. During this process, all
|
||||||
// invalidated transactions (low nonce, low balance) are deleted.
|
// invalidated transactions (low nonce, low balance) are deleted.
|
||||||
func (pool *OrderPool) promoteExecutables(accounts []common.Address) {
|
func (pool *OrderPool) promoteExecutables(accounts []common.Address) {
|
||||||
start := time.Now()
|
defer func(start time.Time) {
|
||||||
defer log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start)))
|
log.Debug("end promoteExecutables", "time", common.PrettyDuration(time.Since(start)))
|
||||||
|
}(time.Now())
|
||||||
|
|
||||||
// Gather all the accounts potentially needing updates
|
// Gather all the accounts potentially needing updates
|
||||||
if accounts == nil {
|
if accounts == nil {
|
||||||
accounts = make([]common.Address, 0, len(pool.queue))
|
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
|
// future queue to the set of pending transactions. During this process, all
|
||||||
// invalidated transactions (low nonce, low balance) are deleted.
|
// invalidated transactions (low nonce, low balance) are deleted.
|
||||||
func (pool *TxPool) promoteExecutables(accounts []common.Address) {
|
func (pool *TxPool) promoteExecutables(accounts []common.Address) {
|
||||||
start := time.Now()
|
|
||||||
log.Debug("start promoteExecutables")
|
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
|
// Gather all the accounts potentially needing updates
|
||||||
if accounts == nil {
|
if accounts == nil {
|
||||||
accounts = make([]common.Address, 0, len(pool.queue))
|
accounts = make([]common.Address, 0, len(pool.queue))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue