aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-09-19 02:41:46 +0800
committerGitHub <noreply@github.com>2017-09-19 02:41:46 +0800
commit190330db921d5549a3e4363308545fb702e0089c (patch)
tree3922ed59c51e4dee8d744d4fc9269ed6d8fee16d
parenta190bb60437e2edcdf7b9be39e69f2d34f2b0957 (diff)
parent99856189ed463d5ff140b36399313993ffd5541c (diff)
downloadtangerine-wallet-browser-190330db921d5549a3e4363308545fb702e0089c.tar.gz
tangerine-wallet-browser-190330db921d5549a3e4363308545fb702e0089c.tar.zst
tangerine-wallet-browser-190330db921d5549a3e4363308545fb702e0089c.zip
Merge branch 'master' into NewUI-flat
-rw-r--r--CHANGELOG.md1
-rw-r--r--ui/app/components/pending-tx.js9
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ba214cce..a82c3e149 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@
- Changed state logs to a file download than a clipboard copy.
- Fixed a long standing memory leak associated with filters installed by dapps
- Fix link to support center.
+- Warn users when a dapp proposes a high gas limit (90% of blockGasLimit or higher)
## 3.10.0 2017-9-11
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index a679107c9..18b622925 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -140,6 +140,13 @@ PendingTx.prototype.getGasFee = function () {
// Gas
const gas = txParams.gas
const gasBn = hexToBn(gas)
+
+ // From latest master
+// const gasLimit = new BN(parseInt(blockGasLimit))
+// const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20)
+// const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20)
+// const safeGasLimit = safeGasLimitBN.toString(10)
+
// Gas Price
const gasPrice = txParams.gasPrice || MIN_GAS_PRICE_BN.toString(16)
const gasPriceBn = hexToBn(gasPrice)
@@ -248,6 +255,8 @@ PendingTx.prototype.render = function () {
// const insufficientBalance = balanceBn.lt(maxCost)
// const buyDisabled = insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting
// const showRejectAll = props.unconfTxListLength > 1
+// const dangerousGasLimit = gasBn.gte(saferGasLimitBN)
+// const gasLimitSpecified = txMeta.gasLimitSpecified
this.inputs = []