You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge dashpay#6797: fix(rpc): return correct error codes in upgradetohd rpc
746e5f8 fix: always leave the wallet in a locked state afer `upgradetohd` (UdjinM6)
b19f463 fix(rpc): return correct error codes in `upgradetohd` rpc (UdjinM6)
Pull request description:
## Issue being fixed or feature implemented
`upgradetohd` rpc returns wrong error codes
## What was done?
Move wallet "upgrade to HD" code used in rpc only to `upgradetohd` rpc, return correct error codes. We also don't need all that logic to extract wallet master encryption key because it's already known when wallet is unlocked.
## How Has This Been Tested?
Run tests
## Breaking Changes
`upgradetohd` should return correct error codes now which could probably break things if you relied on them, see tests
## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
knst:
utACK 746e5f8
Tree-SHA512: 829d1f9d805f7a87f628a9c7f4ae93cb545c8113cea97f430639165dae124db17d389c2f5c663214b074da8ae541435ab7df2b672f78370fe883ac77b3cfed42
if (!pwallet->EncryptWallet(secureWalletPassphrase)) {
462
+
throwJSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Failed to encrypt HD wallet");
463
+
}
464
+
}
465
+
} // pwallet->cs_wallet
419
466
420
467
// If you are generating new mnemonic it is assumed that the addresses have never gotten a transaction before, so you don't need to rescan for transactions
0 commit comments