]> git.codecow.com Git - libnemo.git/commitdiff
Fix pow check when processing block.
authorChris Duncan <chris@zoso.dev>
Fri, 8 Aug 2025 19:08:13 +0000 (12:08 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 8 Aug 2025 19:08:13 +0000 (12:08 -0700)
src/lib/block.ts

index 8a2d342f841a46667cb94c98ab55772c2d050769..32ce1c34a5e6f71bcf5fc3d3b8b1abff50b6f42b 100644 (file)
@@ -263,11 +263,11 @@ export class Block {
        */
        async process (rpc: Rpc): Promise<string> {
                Block.#validate(this)
-               if (!this.signature) {
+               if (this.signature == null) {
                        throw new Error('Block is missing signature. Use sign() and try again.')
                }
-               if (!this.work == null) {
-                       throw new Error('Block is missing proof-of-work. Generate PoW and try again.')
+               if (this.work == null) {
+                       throw new Error('Block is missing proof-of-work. Use pow() and try again.')
                }
                const data = {
                        "subtype": this.subtype,