There was an error while loading. Please reload this page.
1 parent 1979e8a commit a3ccf2dCopy full SHA for a3ccf2d
1 file changed
packages/neuron-wallet/src/services/networks.ts
@@ -46,15 +46,19 @@ export default class NetworksService extends Store {
46
currentNetworkList,
47
})
48
Promise.all(currentNetworkList.map(n => {
49
- const core = new Core(n.remote)
50
- return core.rpc
51
- .getBlockchainInfo()
52
- .then(info => info.chain)
53
- .catch(() => '')
54
- .then(chain => ({
+ if (n.type == NetworkType.Default) {
+ return n
+ } else {
+ const core = new Core(n.remote)
+ return Promise.all([
+ core.rpc.getBlockchainInfo(),
55
+ core.rpc.getBlockHash('0x0')
56
+ ]).then(([info, genesisHash]) => ({
57
...n,
- chain,
58
+ chain: info.chain,
59
+ genesisHash
60
}))
61
+ }
62
})).then(networkList => {
63
this.updateAll(networkList)
64
}).catch((err: Error) => {
0 commit comments