aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/pending-tx.js')
-rw-r--r--ui/app/components/pending-tx.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index e3b307b0b..4b1a00eca 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -32,7 +32,7 @@ function PendingTx () {
PendingTx.prototype.render = function () {
const props = this.props
- const { currentCurrency } = props
+ const { currentCurrency, blockGasLimit } = props
const conversionRate = props.conversionRate
const txMeta = this.gatherTxMeta()
@@ -50,7 +50,8 @@ PendingTx.prototype.render = function () {
// Gas
const gas = txParams.gas
const gasBn = hexToBn(gas)
- const safeGasLimit = parseInt(txMeta.blockGasLimit)
+ const gasLimit = new BN(parseInt(blockGasLimit))
+ const safeGasLimit = this.bnMultiplyByFraction(gasLimit, 19, 20).toString(10)
// Gas Price
const gasPrice = txParams.gasPrice || MIN_GAS_PRICE_BN.toString(16)
@@ -458,6 +459,12 @@ PendingTx.prototype._notZeroOrEmptyString = function (obj) {
return obj !== '' && obj !== '0x0'
}
+PendingTx.prototype.bnMultiplyByFraction = function (targetBN, numerator, denominator) {
+ const numBN = new BN(numerator)
+ const denomBN = new BN(denominator)
+ return targetBN.mul(numBN).div(denomBN)
+}
+
function forwardCarrat () {
return (
h('img', {