forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry pick tx pool fixes from v1.2.3 and v1.2.4 (ethereum#1442)
* Make tx pool fee check logic match the logic in state_transition.go * Improve non-native currency fee tx handling (ethereum#2) Improves multi-currency fee support in the tx pool queue and pending lists. Previously when paying for a tx in a non-native currency, the balance of the account would only be checked when inserting the transaction into the tx pool, but as the balance of the account can change after the tx is admitted, transactions are periodically checked for validity in `txList.Filter`. This PR changes txList to properly track balances in non-native currencies. This also adds support for checking the gas price minimum in the txList. This PR also converts gas prices to CELO prior to comparing if a new transaction at the same nonce should override an old transaction at the same nonce. It also refactors calculations of `tx.Fee()` * Fix nil pointer exception in txList Filter This occurred because gasPriceMinimums contains the gasPriceMinimum for every fee currency, not just the fee currencies of the transfer. This changes the iteration to go through each gasPriceFloor and then get the gasPriceMinimum from the fee currency associated with the floor. This works because gasPriceMinimums contains every whitelisted fee currency and the tx has already been validated to pay in a fee currency. * Fix panic in 'ConvertToGold()' Co-authored-by: Joshua Gutow <[email protected]> Co-authored-by: Joshua Gutow <[email protected]>
- Loading branch information
3 people
authored
Mar 22, 2021
1 parent
3b6a71f
commit 60c3de2
Showing
5 changed files
with
211 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters