diff --git a/package.json b/package.json index eab21f1..59f61fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lumerin/wallet-core", - "version": "1.0.65", + "version": "1.0.66", "author": { "name": "Lumerin", "email": "developer@lumerin.io", diff --git a/src/plugins/proxy-router/connections-manager.js b/src/plugins/proxy-router/connections-manager.js index 076b242..6225fcd 100644 --- a/src/plugins/proxy-router/connections-manager.js +++ b/src/plugins/proxy-router/connections-manager.js @@ -20,19 +20,14 @@ function createConnectionsManager(config, eventBus) { let interval - const getConnections = async (sellerUrl, buyerUrl) => { + const getConnections = async (proxyUrl) => { const getMiners = async (url) => { return (await createAxios({ baseURL: url })('/miners')).data?.Miners } - if (sellerUrl && buyerUrl) { - const sellerMiners = await getMiners(sellerUrl) - const buyerMiners = (await getMiners(buyerUrl)).map((x) => ({ - ...x, - Status: 'busy', - })) - - return [...sellerMiners, ...buyerMiners] + if (proxyUrl) { + const sellerMiners = await getMiners(proxyUrl); + return [...sellerMiners]; } return await getMiners(proxyRouterUrl) @@ -57,7 +52,7 @@ function createConnectionsManager(config, eventBus) { * * @returns {object} The event emitter. */ - function getConnectionsStream(sellerUrl, buyerUrl) { + function getConnectionsStream(proxyUrl) { const stream = new EventEmitter() let isConnected = false @@ -65,7 +60,7 @@ function createConnectionsManager(config, eventBus) { disconnect() interval = setInterval(async () => { try { - const connections = await getConnections(sellerUrl, buyerUrl) + const connections = await getConnections(proxyUrl) if (!isConnected) { isConnected = true diff --git a/src/plugins/proxy-router/index.js b/src/plugins/proxy-router/index.js index 7995915..c1a672f 100644 --- a/src/plugins/proxy-router/index.js +++ b/src/plugins/proxy-router/index.js @@ -15,7 +15,7 @@ function createPlugin() { const refreshConnectionsStream = (data) => connectionManager - .getConnectionsStream(data.sellerNodeUrl, data.buyerNodeUrl) + .getConnectionsStream(data.proxyNodeUrl) .on('data', (data) => { eventBus.emit('proxy-router-connections-changed', { connections: data.connections,