]> zoso.dev Git - libnemo.git/commitdiff
Implement divide option on pool work.
authorChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 01:08:57 +0000 (17:08 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 01:08:57 +0000 (17:08 -0800)
src/lib/wallet.ts

index 59eaa480f1ccf0a2f32a44c3c6ed554eb19b4e02..c768e937feba807939053c3a6992ad27c63130be 100644 (file)
@@ -98,7 +98,7 @@ abstract class Wallet {
                        const data: any = []\r
                        results.forEach(r => data.push({ privateKey: r.privateKey, index: r.index }))\r
                        let now = performance.now()\r
-                       const keypairs: KeyPair[] = await this.#pool.work(data)\r
+                       const keypairs: KeyPair[] = await this.#pool.work('divide', data)\r
                        console.log(`keypairs: ${-now + (now = performance.now())} ms`)\r
                        for (const keypair of keypairs) {\r
                                if (keypair.publicKey == null) throw new RangeError('Account public key missing')\r
@@ -431,7 +431,7 @@ export class Bip44Wallet extends Wallet {
                const data: any = []\r
                indexes.forEach(i => data.push({ seed: this.seed, index: i }))\r
                let now = performance.now()\r
-               const privateKeys: KeyPair[] = await this.#pool.work(data)\r
+               const privateKeys: KeyPair[] = await this.#pool.work('divide', data)\r
                console.log(`ckd: ${-now + (now = performance.now())} ms`)\r
                return privateKeys\r
        }\r