* core: Added GasPriceChange event
* eth: When one of the DB flush methods error a fatal error log message
is given. Hopefully this will prevent corrupted databases from
occuring.
* miner: remove transactions with low gas price. Closes#906, #903
// Keep track of transactions which return errors so they can be removed
var(
remove=set.New()
tcount=0
ignoredTransactors=set.New()
lowGasTransactors=set.New()
ownedAccounts=accountAddressesSet(accounts)
lowGasTxstypes.Transactions
)
constpct=int64(90)
// calculate the minimal gas price the miner accepts when sorting out transactions.
minprice:=gasprice(self.gasPrice,pct)
for_,tx:=rangetransactions{
// We can skip err. It has already been validated in the tx pool
from,_:=tx.From()
// check if it falls within margin
iftx.GasPrice().Cmp(minprice)<0{
iftx.GasPrice().Cmp(self.gasPrice)<0{
// ignore the transaction and transactor. We ignore the transactor
// because nonce will fail after ignoring this transaction so there's
// no point
ignoredTransactors.Add(from)
glog.V(logger.Info).Infof("transaction(%x) below gas price (<%d%% ask price). All sequential txs from this address(%x) will fail\n",tx.Hash().Bytes()[:4],pct,from[:4])
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(self.gasPrice),from[:4])
}
// Continue with the next transaction if the transaction sender is included in
// the low gas tx set. This will also remove the tx and all sequential transaction
// from this transactor
iflowGasTransactors.Has(from){
// add tx to the low gas set. This will be removed at the end of the run