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 3b2bbe0705
Fix dropped tx detection (#8824)
The code for checking whether a transaction was dropped or not was
refactored in #8398, but in the process an off-by-one error was
introduced.

The old version of `_checkIfTxWasDropped` would query for an updated
transaction count from the network, and would consider the pending
transaction to be dropped if the count was above the nonce. However,
the version introduced in #8398 considers the transaction to be dropped
if the count is above *or equal to* the nonce.

The pending transaction nonce is expected to be equal to the
transaction count, because the nonce starts at zero. The transaction
count is equal to the expected next nonce.

The variable name has been updated to make this more clear
(`networkNextNonce` is how the `nonce-tracker` refers to this value).

`parseInt` is now called with an explicit radix of `16` as well, to
ensure both nonce strings are always parsed as hex. In all cases I am
aware of, these nonce strings were prefixed by `0x`, meaning that
`parseInt` would default to a radix of `16`, so this likely doesn't
constitute a functional change.

Fixes #8688
2020-06-16 18:05:48 -03:00
..
ens Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
network Cleanup network enums (#8627) 2020-05-20 08:57:45 -07:00
permissions Fix handling of permissions of removed accounts (#8803) 2020-06-15 10:27:27 -03:00
transactions Fix dropped tx detection (#8824) 2020-06-16 18:05:48 -03:00
alert.js Consolidate connected account alerts (#8802) 2020-06-15 12:08:53 -07:00
app-state.js Persist home tab state (#8612) 2020-05-25 16:31:28 -02:30
cached-balances.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
detect-tokens.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
incoming-transactions.js Cleanup network enums (#8627) 2020-05-20 08:57:45 -07:00
onboarding.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
preferences.js Support IPNS address translations (#8502) 2020-05-14 07:56:27 -02:30
threebox.js Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
token-rates.js Fix TokenRatesController (#8780) 2020-06-10 16:53:37 -03:00