mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-23 12:38:18 +00:00
fix avergae not calculated correctly
This commit is contained in:
parent
592ce4773c
commit
7fa186b636
@ -34,7 +34,7 @@ class GasStation extends Component {
|
|||||||
}).map(gasPrice => {
|
}).map(gasPrice => {
|
||||||
totalWait += this.props.gasOracleStats[gasPrice].totalWait;
|
totalWait += this.props.gasOracleStats[gasPrice].totalWait;
|
||||||
totalTxs += this.props.gasOracleStats[gasPrice].nbTxs;
|
totalTxs += this.props.gasOracleStats[gasPrice].nbTxs;
|
||||||
totalGasPrice = gasPrice * this.props.gasOracleStats[gasPrice].nbTxs;
|
totalGasPrice += gasPrice * this.props.gasOracleStats[gasPrice].nbTxs;
|
||||||
return {
|
return {
|
||||||
gasPrice,
|
gasPrice,
|
||||||
wait: this.props.gasOracleStats[gasPrice].averageWait >= 0.1 ? this.props.gasOracleStats[gasPrice].averageWait : 0.1
|
wait: this.props.gasOracleStats[gasPrice].averageWait >= 0.1 ? this.props.gasOracleStats[gasPrice].averageWait : 0.1
|
||||||
|
@ -28,7 +28,12 @@ class TransactionTracker {
|
|||||||
}
|
}
|
||||||
block.transactions.forEach(transaction => {
|
block.transactions.forEach(transaction => {
|
||||||
if (this.transactions[transaction.hash]) {
|
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');
|
this.events.emit('blockchain:gas:oracle:new');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user