diff --git a/database/migrations/0066-x-community-sendcoins-transactions_table.ts b/database/migrations/0066-x-community-sendcoins-transactions_table.ts index 2a90f297a..425248c22 100644 --- a/database/migrations/0066-x-community-sendcoins-transactions_table.ts +++ b/database/migrations/0066-x-community-sendcoins-transactions_table.ts @@ -66,8 +66,6 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis ) } -/* eslint-disable @typescript-eslint/no-empty-function */ -/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { await queryFn('ALTER TABLE `transactions` DROP COLUMN `user_gradido_id`;') await queryFn('ALTER TABLE `transactions` DROP COLUMN `user_name`;') diff --git a/dht-node/src/dht_node/index.ts b/dht-node/src/dht_node/index.ts index 1bd34d316..efd2ae2f8 100644 --- a/dht-node/src/dht_node/index.ts +++ b/dht-node/src/dht_node/index.ts @@ -250,14 +250,11 @@ async function writeHomeCommunityEntry(pubKey: string): Promise { } const newCommunityUuid = async (): Promise => { - let uuid: string - let countIds: number - do { - uuid = uuidv4() - countIds = await DbCommunity.count({ where: { communityUuid: uuid } }) - if (countIds > 0) { - logger.info('CommunityUuid creation conflict...') + while (true) { + const communityUuid = uuidv4() + if ((await DbCommunity.count({ where: { communityUuid } })) === 0) { + return communityUuid } - } while (countIds > 0) - return uuid + logger.info('CommunityUuid creation conflict...', communityUuid) + } }