aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-04-28 09:46:12 +0800
committerDan Finlay <somniac@me.com>2016-04-28 09:46:12 +0800
commit9b524b4f28bebbdf8351763b61e897f33021e25b (patch)
treed5b0f23ec9803f6956f42f9bbfbbd993608e1285 /app/scripts/background.js
parentc66ac13cc93948945912690dffc4940f33fa1dfa (diff)
parentbd660d9aeb5638372605377fb92ce1362c3d8230 (diff)
downloadtangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.gz
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.bz2
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.lz
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.xz
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.tar.zst
tangerine-wallet-browser-9b524b4f28bebbdf8351763b61e897f33021e25b.zip
Merge pull request #152 from MetaMask/FilterTransactionList
Filter transaction list for current network
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index e5281b8d6..523df1261 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -11,6 +11,7 @@ const createTxNotification = require('./lib/tx-notification.js')
const configManager = require('./lib/config-manager-singleton')
const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex
const HostStore = require('./lib/remote-store.js').HostStore
+const Web3 = require('web3')
//
// connect to other contexts
@@ -51,6 +52,7 @@ function setupTrustedCommunication(connectionStream){
var providerConfig = configManager.getProvider()
var idStore = new IdentityStore()
+
var providerOpts = {
rpcUrl: configManager.getCurrentRpcAddress(),
getAccounts: function(cb){
@@ -62,6 +64,9 @@ var providerOpts = {
signTransaction: idStore.signTransaction.bind(idStore),
}
var provider = MetaMaskProvider(providerOpts)
+var web3 = new Web3(provider)
+idStore.web3 = web3
+idStore.getNetwork(3)
// log new blocks
provider.on('block', function(block){
@@ -222,6 +227,7 @@ function addUnconfirmedTx(txParams, cb){
function setRpcTarget(rpcTarget){
configManager.setRpcTarget(rpcTarget)
chrome.runtime.reload()
+ idStore.getNetwork(3) // 3 retry attempts
}
function useEtherscanProvider() {