Add to GasPriceOracle choice of the same RPC as in the Web3 current instance
This commit is contained in:
parent
8a31e9873d
commit
2186801877
4
cli.js
4
cli.js
@ -26,7 +26,6 @@ const prompt = readline.createInterface({ input: process.stdin, output: process.
|
||||
const gasSpeedPreferences = ['instant', 'fast', 'standard', 'low'];
|
||||
|
||||
let web3,
|
||||
oracle,
|
||||
torPort,
|
||||
tornado,
|
||||
tornadoContract,
|
||||
@ -838,6 +837,8 @@ async function fetchGasPrice() {
|
||||
|
||||
try {
|
||||
const isLegacy = !eipGasSupport;
|
||||
const oracleOptions = { chainId: netId, defaultRpc: web3.currentProvider.host };
|
||||
const oracle = new GasPriceOracle(oracleOptions);
|
||||
const gas = await oracle.gasPrices({ isLegacy });
|
||||
|
||||
if (netId === 1) {
|
||||
@ -1403,7 +1404,6 @@ async function init({ rpc, noteNetId, currency = 'dai', amount = '100', balanceC
|
||||
console.log('Connecting to remote node');
|
||||
web3 = new Web3(rpc, null, { transactionConfirmationBlocks: 1 });
|
||||
}
|
||||
oracle = new GasPriceOracle({ chainId: web3.eth.getChainId(), defaultRpc: rpc });
|
||||
|
||||
const rpcHost = new URL(rpc).hostname;
|
||||
const isIpPrivate = is_ip_private(rpcHost);
|
||||
|
Loading…
Reference in New Issue
Block a user