Apply suggestions from code review
Co-authored-by: Jack Grigg <jack@electriccoin.co>
This commit is contained in:
parent
0da6bcef72
commit
1fb153a333
|
@ -525,7 +525,7 @@ std::pair<UnifiedFullViewingKey, libzcash::AccountId> CWallet::GenerateNewUnifie
|
|||
auto account = hdChain.IncrementAccountCounter();
|
||||
if (!account.has_value()) {
|
||||
throw std::runtime_error(
|
||||
"CWallet::GenerateNewUnifiedSpendingKey(): Account counter overflowed (2^31 - 1).");
|
||||
"CWallet::GenerateNewUnifiedSpendingKey(): Already generated the maxiumum number of accounts (2^31 - 2) for this wallet's mnemonic phrase. Congratulations, you need to create a new wallet!");
|
||||
}
|
||||
|
||||
if (generated.has_value()) {
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
* if the increment operation would cause an overflow. */
|
||||
std::optional<uint32_t> IncrementAccountCounter() {
|
||||
auto newAccountCounter = accountCounter + 1;
|
||||
if (newAccountCounter > (HARDENED_KEY_LIMIT - 1)) {
|
||||
if (newAccountCounter >= libzcash::ZCASH_LEGACY_ACCOUNT) {
|
||||
return std::nullopt;
|
||||
} else {
|
||||
accountCounter = newAccountCounter;
|
||||
|
|
Loading…
Reference in New Issue