Fixes #30102.
Motivation
bitcoin-util grind can exhaust the nonce search space for a candidate signet block header on higher difficulty chains. When this happens, contrib/signet/miner currently exits instead of trying another candidate block.
Changes
Retry mining when the grinder fails with Could not satisfy difficulty target. The retry rebuilds the block with an incremented block time, giving the grinder a fresh header to search.
Other grinder failures still raise the original subprocess error.
Test
The functional test wraps bitcoin-util grind so the first attempt reports target exhaustion and the second attempt delegates to the real grinder. The test uses a signed signet block and records both candidate headers to verify that the retry rebuilds the block before grinding again.
Tested locally with:
python3 -m py_compile contrib/signet/miner test/functional/tool_signet_miner.py
git diff --check origin/master..HEAD
conda-build-env/bin/ninja -C build-clang22-clean bitcoind bitcoin-cli bitcoin-util
PATH=$PWD/conda-build-env/bin:$PATH DYLD_LIBRARY_PATH=$PWD/conda-build-env/lib HOME=$PWD/.conda-home CONDA_NUMBER_CHANNEL_NOTICES=0 CONDA_NO_PLUGINS=true CONDA_PKGS_DIRS=$PWD/.conda-pkgs XDG_CACHE_HOME=$PWD/.cache conda-build-env/bin/python build-clang22-clean/test/functional/test_runner.py --jobs=1 tool_signet_miner.py