// ignore the transaction and transactor. We ignore the transactor
// Pop the current low-priced transaction without shifting in the next from the account
// because nonce will fail after ignoring this transaction so there's
glog.V(logger.Info).Infof("Transaction (%x) below gas price (tx=%v ask=%v). All sequential txs from this address(%x) will be ignored\n",tx.Hash().Bytes()[:4],common.CurrencyToString(tx.GasPrice()),common.CurrencyToString(gasPrice),from[:4])
// no point
env.lowGasTransactors.Add(from)
glog.V(logger.Info).Infof("transaction(%x) below gas price (tx=%v ask=%v). All sequential txs from this address(%x) will be ignored\n",tx.Hash().Bytes()[:4],common.CurrencyToString(tx.GasPrice()),common.CurrencyToString(gasPrice),from[:4])
}
// Continue with the next transaction if the transaction sender is included in
env.lowGasTxs=append(env.lowGasTxs,tx)
// the low gas tx set. This will also remove the tx and all sequential transaction
txs.Pop()
// from this transactor
ifenv.lowGasTransactors.Has(from){
// add tx to the low gas set. This will be removed at the end of the run
// owned accounts are ignored
if!env.ownedAccounts.Has(from){
env.lowGasTxs=append(env.lowGasTxs,tx)
}
continue
}
// Move on to the next transaction when the transactor is in ignored transactions set
// This may occur when a transaction hits the gas limit. When a gas limit is hit and
// the transaction is processed (that could potentially be included in the block) it
// will throw a nonce error because the previous transaction hasn't been processed.
// Therefor we need to ignore any transaction after the ignored one.
ifenv.ignoredTransactors.Has(from){
continue
continue
}
}
// Start executing the transaction
env.state.StartRecord(tx.Hash(),common.Hash{},0)
env.state.StartRecord(tx.Hash(),common.Hash{},0)
err,logs:=env.commitTransaction(tx,bc,gp)
err,logs:=env.commitTransaction(tx,bc,gp)
switch{
switch{
casecore.IsGasLimitErr(err):
casecore.IsGasLimitErr(err):
// ignore the transactor so no nonce errors will be thrown for this account
// Pop the current out-of-gas transaction without shifting in the next from the account
// next time the worker is run, they'll be picked up again.
env.ignoredTransactors.Add(from)
glog.V(logger.Detail).Infof("Gas limit reached for (%x) in this block. Continue to try smaller txs\n",from[:4])
glog.V(logger.Detail).Infof("Gas limit reached for (%x) in this block. Continue to try smaller txs\n",from[:4])
txs.Pop()
caseerr!=nil:
caseerr!=nil:
// Pop the current failed transaction without shifting in the next from the account
glog.V(logger.Detail).Infof("Transaction (%x) failed, will be removed: %v\n",tx.Hash().Bytes()[:4],err)
env.failedTxs=append(env.failedTxs,tx)
env.failedTxs=append(env.failedTxs,tx)
ifglog.V(logger.Detail){
txs.Pop()
glog.Infof("TX (%x) failed, will be removed: %v\n",tx.Hash().Bytes()[:4],err)
}
default:
default:
env.tcount++
// Everything ok, collect the logs and shift in the next transaction from the same account