From 30b45c8a385e9ae4c6b78d0a7ec6929f7bad4d9a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 19 Dec 2017 12:22:48 -0800 Subject: [PATCH] Do not log whole txs in recent block controller. Only record gas prices, because that has a current use. --- app/scripts/controllers/recent-blocks.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/recent-blocks.js b/app/scripts/controllers/recent-blocks.js index 27f9013ff..4a906261e 100644 --- a/app/scripts/controllers/recent-blocks.js +++ b/app/scripts/controllers/recent-blocks.js @@ -23,8 +23,15 @@ class RecentBlocksController { } processBlock (newBlock) { + const block = extend(newBlock, { + gasPrices: newBlock.transactions.map((tx) => { + return tx.gasPrice + }), + }) + delete block.transactions + const state = this.store.getState() - state.recentBlocks.push(newBlock) + state.recentBlocks.push(block) while (state.recentBlocks.length > this.historyLength) { state.recentBlocks.shift()