This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
hasSpendingPassword
is Wrongly Reported as "True" After DB Migration
#96
Labels
BUG
Something isn't working
Milestone
Context
When I create a wallet without a password on the 1.3.1 build and then upgrade\migrate to 2.0.0; the resulting wallet has a spending password enforced.
When migrating from an old data-layer, we don't have much information about whether there was a password defined on a wallet. So, we use to apply some heuristic based on the password last upate timestamp.
This is rather unreliable and can return misleading metadata for wallets which don't have passwords. Because there's no such thing as "no password" (secret keys are actually encrypted with an empty passphrase), it is possible to assess whether a key was encrypted with a password by trying to decrypt with an empty one. If it succeeds, then we can tell for sure that there's no password defined for the given key.
Steps to Reproduce
hasSpendingPassword
metadata attribute and / or observe logsExpected behavior
Actual behavior
Wallet without passwords are actually flagged as having one.
PR
develop
Retrospective
Migration issues are hard to test and aren't covered in any unit or integration tests we have. For the next release, we've reduced migration down to a wallet restoration and have ditched away the recovery of metadata from an old wallet. This also removes a whole class of bugs like this one.
The text was updated successfully, but these errors were encountered: