]> zoso.dev Git - nano-pow.git/commitdiff
Technically, a valid nonce can be equal to the threshold, so fix the final comparison.
authorChris Duncan <chris@zoso.dev>
Wed, 5 Feb 2025 05:02:37 +0000 (21:02 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 5 Feb 2025 05:02:37 +0000 (21:02 -0800)
src/shaders/compute.wgsl

index b0216186d301dc9a4baa6fe7ab335c0eb40248b1..4b145096375eb38edf905088bf89816bd2519c32 100644 (file)
@@ -1456,7 +1456,7 @@ fn main(id: vec3<u32>) {
        * Set nonce if it passes the threshold and no other thread has set it.
        * Only high bits are needed for comparison since threshold low bits are zero.
        */
-       if ((BLAKE2B_IV_0.y ^ v0.y ^ v8.y) > ubo.threshold) {
+       if ((BLAKE2B_IV_0.y ^ v0.y ^ v8.y) >= ubo.threshold) {
                let wasFound: u32 = atomicExchange(&work.found, 1u);
                if (wasFound == 0u) {
                        work.nonce = m0;