* @param {Rpc|string|URL} rpc - RPC node information required to call `work_generate`
*/
async pow (rpc: Rpc | string | URL): Promise<void> {
- 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
}