"ddos challenge" style script #4
1 changed files with 2 additions and 2 deletions
|
|
@ -406,7 +406,7 @@ local function computeValidNonce(challenge, difficulty)
|
|||
local str = require("resty.string")
|
||||
local required_zeros = string.rep("0", difficulty)
|
||||
|
||||
for nonce = 0, 1000000 do
|
||||
for nonce = 0, 150 do
|
||||
local sha256 = resty_sha256:new()
|
||||
sha256:update(challenge .. tostring(nonce))
|
||||
local digest = sha256:final()
|
||||
|
|
@ -417,7 +417,7 @@ local function computeValidNonce(challenge, difficulty)
|
|||
end
|
||||
end
|
||||
|
||||
error("Could not find valid nonce after 1M attempts")
|
||||
error("Could not find valid nonce after 150 attempts")
|
||||
end
|
||||
|
||||
-- Tests for proof-of-work challenge type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue