From 801dbeec3fde07823e278a52fe8b7a4383c35d6c Mon Sep 17 00:00:00 2001 From: "Sam (Sangho Kim)" Date: Tue, 3 Mar 2020 17:16:00 +0900 Subject: [PATCH] allow web3 provider options for bitcore.config.js --- packages/bitcore-node/src/modules/ethereum/api/csp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bitcore-node/src/modules/ethereum/api/csp.ts b/packages/bitcore-node/src/modules/ethereum/api/csp.ts index 7f005fe39b2..b1e61611427 100644 --- a/packages/bitcore-node/src/modules/ethereum/api/csp.ts +++ b/packages/bitcore-node/src/modules/ethereum/api/csp.ts @@ -69,6 +69,7 @@ export class ETHStateProvider extends InternalStateProvider implements IChainSta const protocol = provider.protocol || 'http'; const portString = provider.port || '8545'; const connUrl = `${protocol}://${host}:${portString}`; + const providerOptions = provider.options || {}; let ProviderType; switch (provider.protocol) { case 'ws': @@ -79,7 +80,7 @@ export class ETHStateProvider extends InternalStateProvider implements IChainSta ProviderType = Web3.providers.HttpProvider; break; } - ETHStateProvider.web3[network] = new Web3(new ProviderType(connUrl)); + ETHStateProvider.web3[network] = new Web3(new ProviderType(connUrl, providerOptions)); } return ETHStateProvider.web3[network]; }