Skip to content

Commit 71bdfb8

Browse files
committed
fix: app crash
1 parent 05b1372 commit 71bdfb8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/crypto/account_public_info.c

-2
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,6 @@ int32_t AccountPublicInfoSwitch(uint8_t accountIndex, const char *password, bool
691691
ret = AccountPublicSavePublicInfo(accountIndex, password, addr);
692692
}
693693

694-
CalculateZcashUFVK(accountIndex, password);
695-
696694
#ifdef BTC_ONLY
697695
initMultiSigWalletManager();
698696
ret = LoadCurrentAccountMultisigWallet(password);

src/managers/account_manager.c

+7
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ int32_t CreateNewAccount(uint8_t accountIndex, const uint8_t *entropy, uint8_t e
137137
ret = SaveCurrentAccountInfo();
138138
CHECK_ERRCODE_RETURN_INT(ret);
139139
ret = AccountPublicInfoSwitch(g_currentAccountIndex, password, true);
140+
CalculateZcashUFVK(accountIndex, password);
140141
CHECK_ERRCODE_RETURN_INT(ret);
141142
return ret;
142143
}
@@ -235,6 +236,7 @@ int32_t VerifyPasswordAndLogin(uint8_t *accountIndex, const char *password)
235236
} else {
236237
printf("passphrase not exist, info switch\r\n");
237238
ret = AccountPublicInfoSwitch(g_currentAccountIndex, password, false);
239+
CalculateZcashUFVK(g_currentAccountIndex, password);
238240
}
239241
} else {
240242
g_publicInfo.loginPasswordErrorCount++;
@@ -589,6 +591,11 @@ int32_t GetZcashUFVK(uint8_t accountIndex, char* outUFVK, uint8_t* outSFP) {
589591
int32_t CalculateZcashUFVK(uint8_t accountIndex, const char* password) {
590592
ASSERT(accountIndex <= 2);
591593

594+
if (GetMnemonicType() == MNEMONIC_TYPE_SLIP39 || GetMnemonicType() == MNEMONIC_TYPE_TON)
595+
{
596+
return SUCCESS_CODE;
597+
}
598+
592599
uint8_t seed[SEED_LEN];
593600
int len = GetMnemonicType() == MNEMONIC_TYPE_BIP39 ? sizeof(seed) : GetCurrentAccountEntropyLen();
594601
int32_t ret = GetAccountSeed(accountIndex, &seed, password);

0 commit comments

Comments
 (0)