From: Chris Duncan Date: Sat, 21 Dec 2024 15:26:04 +0000 (-0800) Subject: Keep Pow pool static across all Block instances. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=cae667619e04261aef5bb4fbe7545d7809fc4c05;p=libnemo.git Keep Pow pool static across all Block instances. --- diff --git a/src/lib/block.ts b/src/lib/block.ts index 80948bd..da23d56 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -16,7 +16,7 @@ import { Pow } from './workers.js' * of three derived classes: SendBlock, ReceiveBlock, ChangeBlock. */ abstract class Block { - #pool: Pool = new Pool(Pow) + static #pool: Pool = new Pool(Pow) account: Account type: string = 'state' abstract subtype: 'send' | 'receive' | 'change' @@ -89,7 +89,7 @@ abstract class Block { ? THRESHOLD_SEND : THRESHOLD_RECEIVE } - const [{ work }] = await this.#pool.assign([data]) + const [{ work }] = await Block.#pool.assign([data]) this.work = work }