From: Chris Duncan Date: Tue, 3 Dec 2024 01:08:02 +0000 (-0800) Subject: Implement nano-webgl-pow on block. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=bdf1ec15e2492b6208ce3dbec8b1ba488b0eaea7;p=libnemo.git Implement nano-webgl-pow on block. --- diff --git a/src/lib/block.ts b/src/lib/block.ts index bbe6e72..b5ca2df 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -86,16 +86,17 @@ abstract class Block { * @param {Rpc|string|URL} rpc - RPC node information required to call `work_generate` */ async pow (rpc: Rpc | string | URL): Promise { - if (typeof rpc === 'string' || rpc.constructor === URL) { - rpc = new Rpc(rpc) - } - if (rpc.constructor !== Rpc) { - throw new TypeError('RPC must be a valid node') - } + // if (typeof rpc === 'string' || rpc.constructor === URL) { + // rpc = new Rpc(rpc) + // } + // if (rpc.constructor !== Rpc) { + // throw new TypeError('RPC must be a valid node') + // } const data = { "hash": this.previous } - const { work } = await rpc.call('work_generate', data) + // const { work } = await rpc.call('work_generate', data) + const { work } = await this.#pool.work('converge', [data]) this.work = work }