Skip to content

Honor context cancellation during PoW solve #230

@CJackHwang

Description

@CJackHwang

P2 Badge Honor context cancellation during PoW solve

GetPow still accepts a request-scoped ctx, but this call now invokes ComputePow(challenge) without passing that context. Because the new pure-Go solver performs a CPU-bound search up to difficulty, canceled HTTP requests (client disconnects, timeouts, shutdown) will continue hashing until the loop completes, wasting CPU and delaying goroutine cleanup. Please thread ctx through the solver and check ctx.Done() periodically during the nonce scan.

Useful? React with 👍 / 👎.

Originally posted by @chatgpt-codex-connector in #229 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions