Retrieve gasLimit on new blocks

This commit is contained in:
Jaco Greeff 2016-11-18 12:24:32 +01:00
parent b79d65c0f3
commit 5dcb3cbffb
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,15 @@ export default class Status {
}
this._store.dispatch(statusBlockNumber(blockNumber));
this._api.eth
.getBlockByNumber(blockNumber)
.then((block) => {
this._store.dispatch(statusCollection({ gasLimit: block.gasLimit }));
})
.catch((error) => {
console.warn('status._subscribeBlockNumber', 'getBlockByNumber', error);
});
})
.then((subscriptionId) => {
console.log('status._subscribeBlockNumber', 'subscriptionId', subscriptionId);

View File

@ -28,6 +28,7 @@ const initialState = {
enode: '',
extraData: '',
gasFloorTarget: new BigNumber(0),
gasLimit: new BigNumber(0),
hashrate: new BigNumber(0),
minGasPrice: new BigNumber(0),
netChain: 'morden',