1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #1050 from MetaMask/fixConfTxBalanceLogic

Fix conf tx balance logic
This commit is contained in:
kumavis 2017-01-24 15:00:46 -08:00 committed by GitHub
commit 23c2b0b9a5
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
## Current Master
- Fix rendering bug where the Confirm transaction view would lets you approve transactions when the account has insufficient balance.
- Add ability to import accounts in JSON file format (used by Mist, Geth, MyEtherWallet, and more!)
## 3.1.1 2017-1-20

View File

@ -134,7 +134,7 @@ ConfirmTxScreen.prototype.checkBalanceAgainstTx = function (txData) {
var address = txData.txParams.from || state.selectedAccount
var account = state.accounts[address]
var balance = account ? account.balance : '0x0'
var maxCost = new BN(txData.maxCost)
var maxCost = new BN(txData.maxCost, 16)
var balanceBn = new BN(ethUtil.stripHexPrefix(balance), 16)
return maxCost.gt(balanceBn)