From: Chris Duncan Date: Tue, 3 Dec 2024 01:08:57 +0000 (-0800) Subject: Implement divide option on pool work. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=58d13f2bd2815309d9495b259f5d29a768e5158a;p=libnemo.git Implement divide option on pool work. --- diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index 59eaa48..c768e93 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -98,7 +98,7 @@ abstract class Wallet { const data: any = [] results.forEach(r => data.push({ privateKey: r.privateKey, index: r.index })) let now = performance.now() - const keypairs: KeyPair[] = await this.#pool.work(data) + const keypairs: KeyPair[] = await this.#pool.work('divide', data) console.log(`keypairs: ${-now + (now = performance.now())} ms`) for (const keypair of keypairs) { if (keypair.publicKey == null) throw new RangeError('Account public key missing') @@ -431,7 +431,7 @@ export class Bip44Wallet extends Wallet { const data: any = [] indexes.forEach(i => data.push({ seed: this.seed, index: i })) let now = performance.now() - const privateKeys: KeyPair[] = await this.#pool.work(data) + const privateKeys: KeyPair[] = await this.#pool.work('divide', data) console.log(`ckd: ${-now + (now = performance.now())} ms`) return privateKeys }