1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts/controllers
Mark Stacey 5b5b67a985
Fix default gas race condition (#8490)
A race condition exists where after adding an unapproved transaction,
it could be mutated and then replaced when the default gas parameters
are set. This happens because the transaction is added to state and
broadcast before the default gas parameters are set, because
calculating the default gas parameters to use takes some time.
Once they've been calculated, the false assumption was made that the
transaction hadn't changed.

The method responsible for setting the default gas now retrieves an
up-to-date copy of `txMeta`, and conditionally sets the defaults only
if they haven't yet been set.

This race condition was introduced in #2962, though that PR also added
a loading screen that avoided this issue by preventing the user from
interacting with the transaction until after the gas had been
estimated. Unfortunately this loading screen was not carried forward to
the new UI.
2020-05-01 12:25:45 -03:00
..
ens Use ethereum-ens-network-map for network support (#7960) 2020-01-31 09:56:50 -03:30
network Implementation encrypt/decrypt feature (#7831) 2020-02-19 14:24:16 -04:00
permissions Add PermissionsController.removePermittedAccount (#8354) 2020-04-20 11:34:56 -07:00
transactions Fix default gas race condition (#8490) 2020-05-01 12:25:45 -03:00
ab-test.js Remove usages of xtend from the background scripts (#7796) 2020-01-13 08:59:36 -10:00
app-state.js Delete Dai/Sai migration notification (#8418) 2020-04-27 16:23:43 -02:30
balance.js Consistent jsdoc syntax (#7755) 2020-01-13 14:36:36 -04:00
cached-balances.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
detect-tokens.js Cleanup detect-tokens controller and tests (#8329) 2020-04-13 17:14:42 -03:00
incoming-transactions.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
infura.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00
onboarding.js Remove usages of xtend from the background scripts (#7796) 2020-01-13 08:59:36 -10:00
preferences.js Remove unused currentAccountTab state (#8404) 2020-04-24 00:23:28 -03:00
README.md add READMEs to folders, re #3427 2018-03-14 15:33:22 +02:00
recent-blocks.js Remove usages of xtend from the background scripts (#7796) 2020-01-13 08:59:36 -10:00
threebox.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
token-rates.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00

Controllers

Different controllers (in the sense of *VC *View-Controller).