Merged
Conversation
JaredTate
added a commit
that referenced
this pull request
Mar 12, 2026
…22) PROBLEM: During rescan/revalidation, ValidateDigiDollarTransaction checks lockTime - ctx.nHeight to verify the lock tier matches the lock duration. But ctx.nHeight is the CURRENT chain tip during rescan, not the original block height. Historical mints where lockTime < currentHeight produce a negative result and are falsely rejected as 'bad-mint-lock-height-mismatch'. This blocked rescan on 3+ testnet nodes. FIX: If lockTime <= ctx.nHeight or skipOracleValidation is set, the mint has already matured — skip the tier consistency check. The security check is still enforced for fresh mints entering the mempool. TESTS: 4 new test cases in digidollar_lock_height_tests.cpp: - rescan_mature_mint_passes (matured historical mint validates) - rescan_immature_mint_still_valid (in-progress lock during rescan validates) - fresh_mint_tier_mismatch_fails (short lock claiming long tier rejected) - fresh_mint_tier_correct_passes (correct tier/lock combo accepted) Files changed: src/digidollar/validation.cpp, src/test/digidollar_lock_height_tests.cpp, src/Makefile.test.include
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.
DigiByte specific miner_tests
What is the intention of this PR?
This PR fixes the
miner_testswith DigiByte's specific Mining Parameters.Unfortunately, this one required a big custom-made mining script and additional hours of mining in order to generate the test vectors. If something is wrong we have to regenerate those, but on my machines the test is working great so far.
Description of the changes
The commit SmartArray@56f829f adds a custom code snipped to
contrib/testgenand updates theminer_testsunit test with the test vectors generated using that code snipped. Furthermore, it fixes a bunch of other issues in order to have 100% coverage.SmartArray@30330b2 removes a debug statement.
How to verify?
Expected outcome