diff --git a/embark-ui/src/components/GasStation.js b/embark-ui/src/components/GasStation.js index 786c48c6..ba6d4956 100644 --- a/embark-ui/src/components/GasStation.js +++ b/embark-ui/src/components/GasStation.js @@ -34,7 +34,7 @@ class GasStation extends Component { }).map(gasPrice => { totalWait += this.props.gasOracleStats[gasPrice].totalWait; totalTxs += this.props.gasOracleStats[gasPrice].nbTxs; - totalGasPrice = gasPrice * this.props.gasOracleStats[gasPrice].nbTxs; + totalGasPrice += gasPrice * this.props.gasOracleStats[gasPrice].nbTxs; return { gasPrice, wait: this.props.gasOracleStats[gasPrice].averageWait >= 0.1 ? this.props.gasOracleStats[gasPrice].averageWait : 0.1 diff --git a/lib/modules/transactionTracker/index.js b/lib/modules/transactionTracker/index.js index 2fc3f41a..4fc5e898 100644 --- a/lib/modules/transactionTracker/index.js +++ b/lib/modules/transactionTracker/index.js @@ -28,7 +28,12 @@ class TransactionTracker { } block.transactions.forEach(transaction => { if (this.transactions[transaction.hash]) { - Object.assign(this.transactions[transaction.hash], transaction, {endTimestamp: block.timestamp, wait: block.timestamp - this.transactions[transaction.hash].startTimestamp}); + let wait = block.timestamp - this.transactions[transaction.hash].startTimestamp; + if (wait < 0.1) { + wait = 0.1; + } + Object.assign(this.transactions[transaction.hash], + {endTimestamp: block.timestamp, wait, gasPrice: transaction.gasPrice}); } }); this.events.emit('blockchain:gas:oracle:new');