mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-15 08:23:46 +00:00
commit logs
This commit is contained in:
parent
54f97b8598
commit
027025852e
1 changed files with 16 additions and 0 deletions
|
|
@ -918,6 +918,19 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP
|
||||||
}
|
}
|
||||||
var coalescedLogs []*types.Log
|
var coalescedLogs []*types.Log
|
||||||
|
|
||||||
|
initialGasLimit := env.gasPool.Gas()
|
||||||
|
initialTxs := txs.GetTxs()
|
||||||
|
var breakCause string
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
log.Warn("commitTransactions-stats",
|
||||||
|
"initialTxsCount", initialTxs,
|
||||||
|
"initialGasLimit", initialGasLimit,
|
||||||
|
"resultTxsCount", txs.GetTxs(),
|
||||||
|
"resultGapPool", env.gasPool.Gas(),
|
||||||
|
"exitCause", breakCause)
|
||||||
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// In the following three cases, we will interrupt the execution of the transaction.
|
// In the following three cases, we will interrupt the execution of the transaction.
|
||||||
// (1) new head block event arrival, the interrupt signal is 1
|
// (1) new head block event arrival, the interrupt signal is 1
|
||||||
|
|
@ -937,16 +950,19 @@ func (w *worker) commitTransactions(env *environment, txs *types.TransactionsByP
|
||||||
inc: true,
|
inc: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
breakCause = "interrupt"
|
||||||
return atomic.LoadInt32(interrupt) == commitInterruptNewHead
|
return atomic.LoadInt32(interrupt) == commitInterruptNewHead
|
||||||
}
|
}
|
||||||
// If we don't have enough gas for any further transactions then we're done
|
// If we don't have enough gas for any further transactions then we're done
|
||||||
if env.gasPool.Gas() < params.TxGas {
|
if env.gasPool.Gas() < params.TxGas {
|
||||||
log.Trace("Not enough gas for further transactions", "have", env.gasPool, "want", params.TxGas)
|
log.Trace("Not enough gas for further transactions", "have", env.gasPool, "want", params.TxGas)
|
||||||
|
breakCause = "Not enough gas for further transactions"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Retrieve the next transaction and abort if all done
|
// Retrieve the next transaction and abort if all done
|
||||||
tx := txs.Peek()
|
tx := txs.Peek()
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
|
breakCause = "all transactions has been included"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Error may be ignored here. The error has already been checked
|
// Error may be ignored here. The error has already been checked
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue