Merged
Conversation
```ini
gen=1
genproclimit=1
mint=1
```
The daemon would:
1. Show `"numthreads": 0` in `getmininginfo`
2. Potentially hang on startup
However, manually running `./verus setgenerate true 1` after startup worked correctly.
The `komodo_args()` function runs **before** the configuration file is loaded.
In bitcoind.cpp:
| Line | Code | Description |
|------|------|-------------|
| 113 | `ParseParameters(argc, argv)` | Command-line args parsed |
| 142 | `komodo_args(argv[0])` | Sets `KOMODO_MININGTHREADS` |
| 161 | `ReadConfigFile(mapArgs, mapMultiArgs)` | **Config file loaded here** |
When `komodo_args()` executes (line 142), it checks for `-gen` in `komodo_utils.h:1746-1750`:
```cpp
if ( GetBoolArg("-gen", false) != 0 )
{
KOMODO_MININGTHREADS = GetArg("-genproclimit",-1);
}
else KOMODO_MININGTHREADS = 0;
```
At this point, `mapArgs` only contains **command-line arguments**. Config file settings (`gen=1`, `genproclimit=1`, `mint=1`) haven't been loaded yet.
Since `-gen` isn't found, `KOMODO_MININGTHREADS` is set to `0` and never updated.
1. **Added `extern` declaration** for `KOMODO_MININGTHREADS` in init.cpp
2. **Set `KOMODO_MININGTHREADS`** in init.cpp after the config file has been read
3. **Moved `GenerateBitcoins()` call** to after `SetRPCWarmupFinished()` to ensure the node is fully initialized before starting mining threads
**init.cpp:**
- Added `extern int32_t KOMODO_MININGTHREADS;` declaration
- Set `KOMODO_MININGTHREADS` from config after it's loaded
- Deferred `GenerateBitcoins()` until after RPC warmup completes
---
Config args not being loaded from .conf file
Update version and deprecation height
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.