Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Keep track of block gasLimit #3506

Merged
merged 2 commits into from
Nov 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions js/src/redux/providers/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ export default class Status {
}

this._store.dispatch(statusBlockNumber(blockNumber));

this._api.eth
.getBlockByNumber(blockNumber)
.then((block) => {
this._store.dispatch(statusCollection({ gasLimit: block.gasLimit }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we store any other informations back from this request ? I know we are fetching timestamps for transactions from the blockNumber, we might want to store it.. Or not... It should take only 50kB of memory for one day of data, might be worth it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same. However I would rather not store for the sake of storing - so rather when we have a need for it, come and extract it as opposed to extract it and look for a use at some point down the line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair

})
.catch((error) => {
console.warn('status._subscribeBlockNumber', 'getBlockByNumber', error);
});
})
.then((subscriptionId) => {
console.log('status._subscribeBlockNumber', 'subscriptionId', subscriptionId);
Expand Down
1 change: 1 addition & 0 deletions js/src/redux/providers/statusReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down