[bug] Outdated api call in connectAddresses + don't connect with ourselves
This commit is contained in:
parent
a1ce472cad
commit
6b77ec2972
@ -204,8 +204,11 @@ export default class Services {
|
|||||||
// Ensure the amount is available before proceeding
|
// Ensure the amount is available before proceeding
|
||||||
await this.getTokensFromFaucet();
|
await this.getTokensFromFaucet();
|
||||||
let unconnectedAddresses = [];
|
let unconnectedAddresses = [];
|
||||||
|
const myAddress = this.getDeviceAddress();
|
||||||
for (const member of members) {
|
for (const member of members) {
|
||||||
for (const address of member.sp_addresses) {
|
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);
|
const sharedSecret = await this.getSecretForAddress(address);
|
||||||
if (!sharedSecret) {
|
if (!sharedSecret) {
|
||||||
unconnectedAddresses.push(address);
|
unconnectedAddresses.push(address);
|
||||||
@ -224,7 +227,7 @@ export default class Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return this.sdkClient.create_connect_transaction(addresses, 1);
|
return this.sdkClient.create_transaction(addresses, 1);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Failed to connect member:', e);
|
console.error('Failed to connect member:', e);
|
||||||
throw e;
|
throw e;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user