[bug] Outdated api call in connectAddresses + don't connect with ourselves

This commit is contained in:
NicolasCantu 2025-05-20 15:06:14 +02:00
parent a1ce472cad
commit 6b77ec2972

View File

@ -204,8 +204,11 @@ export default class Services {
// Ensure the amount is available before proceeding
await this.getTokensFromFaucet();
let unconnectedAddresses = [];
const myAddress = this.getDeviceAddress();
for (const member of members) {
for (const address of member.sp_addresses) {
// For now, we ignore our own device address, although there might be use cases for having a secret with ourselves
if (address == myAddress) continue;
const sharedSecret = await this.getSecretForAddress(address);
if (!sharedSecret) {
unconnectedAddresses.push(address);
@ -224,7 +227,7 @@ export default class Services {
}
try {
return this.sdkClient.create_connect_transaction(addresses, 1);
return this.sdkClient.create_transaction(addresses, 1);
} catch (e) {
console.error('Failed to connect member:', e);
throw e;