diff --git a/Desktop/DesktopApp.js b/Desktop/DesktopApp.js index 329542347..78a592757 100644 --- a/Desktop/DesktopApp.js +++ b/Desktop/DesktopApp.js @@ -21,7 +21,7 @@ exports.newDesktopApp = function newDesktopApp() { /* We can join now the P2P Network as a client app. */ - thisObject.p2pMetwork = SA.projects.network.modules.p2pMetwork.newNetworkModulesP2PNetwork() + thisObject.p2pMetwork = SA.projects.network.modules.p2pNetwork.newNetworkModulesP2PNetwork() await thisObject.p2pMetwork.initialize('Network Client') /* Here we will pick a Network Node from all users profiles available that do have a Network Node running. diff --git a/Projects/Network/SA/Modules/P2PNetworkNode.js b/Projects/Network/SA/Modules/P2PNetworkNode.js index a3a821653..1fc44ec94 100644 --- a/Projects/Network/SA/Modules/P2PNetworkNode.js +++ b/Projects/Network/SA/Modules/P2PNetworkNode.js @@ -5,7 +5,8 @@ exports.newNetworkModulesP2PNetworkNode = function newNetworkModulesP2PNetworkNo let thisObject = { node: undefined, - userPofile: undefined, + blockchainAccount: undefined, + userProfile: undefined, /* Framework Functions */ initialize: initialize, @@ -16,14 +17,16 @@ exports.newNetworkModulesP2PNetworkNode = function newNetworkModulesP2PNetworkNo function finalize() { thisObject.node = undefined - thisObject.userPofile = undefined + thisObject.blockchainAccount = undefined + thisObject.userProfile = undefined } - async function initialize(node, userPofile) { + async function initialize(node, userProfile, blockchainAccount) { /* We will setup here the maps and arryas we will need to operate within the P2P Network. */ thisObject.node = node - thisObject.userPofile = userPofile + thisObject.userProfile = userProfile + thisObject.blockchainAccount = blockchainAccount } } \ No newline at end of file diff --git a/Projects/Network/SA/Modules/UserProfiles.js b/Projects/Network/SA/Modules/UserProfiles.js index 63a6d2d61..c9493dc31 100644 --- a/Projects/Network/SA/Modules/UserProfiles.js +++ b/Projects/Network/SA/Modules/UserProfiles.js @@ -64,8 +64,7 @@ exports.newNetworkModulesUserProfiles = function newNetworkModulesUserProfiles() let config = JSON.parse(signingAccount.config) let signatureObject = config.signature let web3 = new SA.nodeModules.web3() - let blockchainAccount = web3.eth.accounts.recover(signatureObject) - SA.projects.network.globals.memory.maps.USER_PROFILES_BY_BLOKCHAIN_ACCOUNT.set(blockchainAccount, userProfile) + let blockchainAccount = web3.eth.accounts.recover(signatureObject) /* If the Signing Account is for a P2P node, we will add the node to the array of available nodes at the p2p network. */ @@ -88,7 +87,7 @@ exports.newNetworkModulesUserProfiles = function newNetworkModulesUserProfiles() } p2pNetworkNode = SA.projects.network.modules.p2pNetworkNode.newNetworkModulesP2PNetworkNode() - p2pNetworkNode.initialize(signingAccount.signingAccountChild, userProfile) + p2pNetworkNode.initialize(signingAccount.signingAccountChild, userProfile, blockchainAccount) SA.projects.network.globals.memory.arrays.P2P_NETWORK_NODES.push(p2pNetworkNode) } } diff --git a/Projects/Network/SA/Modules/WebSocketsNetworkClient.js b/Projects/Network/SA/Modules/WebSocketsNetworkClient.js index a41ef6eae..15b34ecba 100644 --- a/Projects/Network/SA/Modules/WebSocketsNetworkClient.js +++ b/Projects/Network/SA/Modules/WebSocketsNetworkClient.js @@ -106,7 +106,7 @@ exports.newNetworkModulesWebSocketsNetworkClient = function newNetworkModulesWeb We will check that the blockchain account taken from the signature matches the one we have on record for the user profile of the Network Node we are calling. */ - if (called.blockchainAccount !== p2pNetworkNode.userProfile.blockchainAccount) { + if (called.blockchainAccount !== p2pNetworkNode.blockchainAccount) { console.log('[ERROR] Web Sockets Client -> stepOneResponse -> The Network Node called does not have the expected Profile Handle.') reject() return