You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a2919b5
Browse filesBrowse the repository at this point in the historyBrowse files
core, eth, miner: improved tx removal & fatal error on db sync err
* 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. Closesbnb-chain#906, bnb-chain#903
// Keep track of transactions which return errors so they can be removed
273
280
var (
274
281
remove=set.New()
275
282
tcount=0
276
283
ignoredTransactors=set.New()
284
+
lowGasTransactors=set.New()
285
+
ownedAccounts=accountAddressesSet(accounts)
286
+
lowGasTxs types.Transactions
277
287
)
278
288
279
-
constpct=int64(90)
280
-
// calculate the minimal gas price the miner accepts when sorting out transactions.
281
-
minprice:=gasprice(self.gasPrice, pct)
282
289
for_, tx:=rangetransactions {
283
290
// We can skip err. It has already been validated in the tx pool
284
291
from, _:=tx.From()
285
292
286
293
// check if it falls within margin
287
-
iftx.GasPrice().Cmp(minprice) <0 {
294
+
iftx.GasPrice().Cmp(self.gasPrice) <0 {
288
295
// ignore the transaction and transactor. We ignore the transactor
289
296
// because nonce will fail after ignoring this transaction so there's
290
297
// no point
291
-
ignoredTransactors.Add(from)
292
-
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])
298
+
lowGasTransactors.Add(from)
299
+
300
+
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])
301
+
}
302
+
303
+
// Continue with the next transaction if the transaction sender is included in
304
+
// the low gas tx set. This will also remove the tx and all sequential transaction
305
+
// from this transactor
306
+
iflowGasTransactors.Has(from) {
307
+
// add tx to the low gas set. This will be removed at the end of the run
0 commit comments