1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/app/scripts
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
..
account-import-strategies Clean up "JSON File" import strategy test output (#7855) 2020-01-17 19:59:47 -03:30
controllers Fix dropped tx detection (#8824) 2020-06-16 18:05:48 -03:00
lib Fix encrypt/decrypt beforeunload bugs (#8816) 2020-06-16 07:40:00 -07:00
migrations Delete the ABTestController and its state (#8620) 2020-05-19 13:27:06 -02:30
platforms Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
background.js Stop reporting failed transactions to Sentry (#8795) 2020-06-12 16:41:57 -03:00
chromereload.js Fix console.error references 2016-08-29 17:32:39 -07:00
contentscript.js blocklisted -> blocked 2020-06-08 17:57:59 -07:00
first-time-state.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
inpage.js Define global web3 as non-enumerable (#8634) 2020-05-20 20:18:25 -07:00
metamask-controller.js Consolidate connected account alerts (#8802) 2020-06-15 12:08:53 -07:00
phishing-detect.js blacklist -> blocklist; whitelist -> safelist 2020-06-08 17:49:36 -07:00
ui.js Omit state snapshot from Sentry errors (#8794) 2020-06-12 16:13:14 -03:00