Remove dead wallet version-gating code (#405)#443
Merged
Conversation
Every WalletFeature constant was collapsed to FEATURE_BASE = 10500, making CanSupportFeature() always true, SetMinVersion() a permanent no-op, and every version-conditional branch's else-arm unreachable. - Collapse the WalletFeature enum to FEATURE_BASE/FEATURE_LATEST only; delete the six intermediate constants inherited from Bitcoin Core that were never meaningful in Tapyrus. - Remove CanSupportFeature(), SetMaxVersion(), and nWalletMaxVersion; simplify SetMinVersion() to just write the version when it advances. - Drop the dead uncompressed-key branch in GenerateNewKey() and a tautological assert in DeriveNewChildKey() (Tapyrus always uses compressed keys and HD chain split). - Collapse the now-always-true CanSupportFeature(FEATURE_HD_SPLIT) conjuncts in SetHDSeed/TopUpKeyPool/ReserveKeyFromKeyPool/ GetOldestKeyPoolTime/getwalletinfo down to their genuinely conditional IsHDEnabled() checks. - Keep the SetMinVersion(FEATURE_BASE, ...) calls in EncryptWallet and the -upgradewallet HD-upgrade path: these aren't dead for a wallet loaded from an older/foreign wallet.dat with a stored version below FEATURE_BASE. Introducing a new wallet-format version tied to coloured-coin GUI support (steps 2/3/8 of the chaintope#405 recommendation) is deferred: no such on-disk format change exists anywhere in the repo today, so there is nothing yet for a version bump to gate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
azuchi
approved these changes
Jul 15, 2026
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.
Every WalletFeature constant was collapsed to FEATURE_BASE = 10500, making CanSupportFeature() always true, SetMinVersion() a permanent no-op, and every version-conditional branch's else-arm unreachable.
Introducing a new wallet-format version tied to coloured-coin GUI support (steps 2/3/8 of the #405 recommendation) is not needed as no such on-disk format change exists.