Repository navigation
Conversation
An old seed decodes to an odd number of hex digits when one of its word triples is worth 2**32 or more. Since 4.6.1 such seeds fail on import, and wallets restored from them earlier can no longer sign. Accept them again. get_seed now raises a clear error for them, as mn_encode cannot encode them. fixes spesmilo#11045
fametrano
force-pushed
the
old-seed-odd-length
branch
from
October 23, 2026 23:59
ab7ca79 to
bf0f5d8
Compare
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.
Some pre-2.0 seeds decode to an odd number of hex digits: a word triple worth 2**32 or more takes 9 hex digits instead of 8. Since 4.6.1
Old_KeyStorerequires even-length hex, so importing such a seed fails, and a wallet restored from one by an older version can no longer sign or change its password.This makes
Old_KeyStoreaccept any number of hex digits. An encrypted seed is base64, a multiple of 4 characters long, so it is still told apart from a plain one. The tests use the mpk, addresses and private key that 4.2.1 gives for the seed in #11045, andget_seednow gives a clear error for these seeds. I left alone the order inAbstract_Wallet.update_password, which sets the storage password before the keystore one. The fix already stops these wallets failing at the keystore step, and swapping the order alone would not make a password change atomic.Fixes #11045.