]> zoso.dev Git - nano-pow.git/commitdiff
Update private function name for consistency.
authorChris Duncan <chris@zoso.dev>
Thu, 24 Apr 2025 22:08:53 +0000 (15:08 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 24 Apr 2025 22:08:53 +0000 (15:08 -0700)
src/lib/gpu/index.ts

index 314783e6e4fe469fa60a85d580dcdbd6ae320f71..ebe35ad69172935a48033e7f75bb70a57a00da5e 100644 (file)
@@ -204,7 +204,7 @@ export class NanoPowGpu {
                return { difficulty, effort }
        }
 
-       static async #dispatch (pipeline: GPUComputePipeline, seed: bigint, hash: string, difficulty: bigint, passes: number): Promise<void> {
+       static async #work_dispatch (pipeline: GPUComputePipeline, seed: bigint, hash: string, difficulty: bigint, passes: number): Promise<void> {
                if (this.#device == null) throw new Error(`WebGPU device failed to load.`)
                // Set up uniform buffer object
                // Note: u32 size is 4, but total alignment must be multiple of 16
@@ -273,7 +273,7 @@ export class NanoPowGpu {
                        random = BigInt(Math.floor(Math.random() * 0xffffffff))
                        seed = (seed & 0xffffffffn) << 32n | random
                        if (this.#debug) console.log('seed', seed.toString(16).padStart(16, '0'))
-                       await this.#dispatch(this.#searchPipeline, seed, hash, difficulty, effort)
+                       await this.#work_dispatch(this.#searchPipeline, seed, hash, difficulty, effort)
                        const found = !!this.#resultView.getUint32(0)
                        nonce = this.#resultView.getBigUint64(8, true)
                        result = this.#resultView.getBigUint64(16, true)
@@ -308,7 +308,7 @@ export class NanoPowGpu {
 
                const seed = BigInt(`0x${work}`)
                if (this.#debug) console.log('work', work)
-               await this.#dispatch(this.#validatePipeline, seed, hash, difficulty, 1)
+               await this.#work_dispatch(this.#validatePipeline, seed, hash, difficulty, 1)
                nonce = this.#resultView.getBigUint64(8, true)
                result = this.#resultView.getBigUint64(16, true)
                this.#busy = false