2020// ! Value for the first BIP 32 hardened derivation. Can be used as a bit mask and as a value. See BIP 32 for more details.
2121const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000 ;
2222
23- bool LegacyScriptPubKeyMan::GetNewDestination (const OutputType type, CTxDestination& dest, std::string & error)
23+ bool LegacyScriptPubKeyMan::GetNewDestination (const OutputType type, CTxDestination& dest, bilingual_str & error)
2424{
2525 if (LEGACY_OUTPUT_TYPES.count (type) == 0 ) {
26- error = _ (" Error: Legacy wallets only support the \" legacy\" , \" p2sh-segwit\" , and \" bech32\" address types" ). translated ;
26+ error = _ (" Error: Legacy wallets only support the \" legacy\" , \" p2sh-segwit\" , and \" bech32\" address types" );
2727 return false ;
2828 }
2929 assert (type != OutputType::BECH32M);
@@ -34,7 +34,7 @@ bool LegacyScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDestinat
3434 // Generate a new key that is added to wallet
3535 CPubKey new_key;
3636 if (!GetKeyFromPool (new_key, type)) {
37- error = _ (" Error: Keypool ran out, please call keypoolrefill first" ). translated ;
37+ error = _ (" Error: Keypool ran out, please call keypoolrefill first" );
3838 return false ;
3939 }
4040 LearnRelatedScripts (new_key, type);
@@ -295,22 +295,22 @@ bool LegacyScriptPubKeyMan::Encrypt(const CKeyingMaterial& master_key, WalletBat
295295 return true ;
296296}
297297
298- bool LegacyScriptPubKeyMan::GetReservedDestination (const OutputType type, bool internal, CTxDestination& address, int64_t & index, CKeyPool& keypool, std::string & error)
298+ bool LegacyScriptPubKeyMan::GetReservedDestination (const OutputType type, bool internal, CTxDestination& address, int64_t & index, CKeyPool& keypool, bilingual_str & error)
299299{
300300 if (LEGACY_OUTPUT_TYPES.count (type) == 0 ) {
301- error = _ (" Error: Legacy wallets only support the \" legacy\" , \" p2sh-segwit\" , and \" bech32\" address types" ). translated ;
301+ error = _ (" Error: Legacy wallets only support the \" legacy\" , \" p2sh-segwit\" , and \" bech32\" address types" );
302302 return false ;
303303 }
304304 assert (type != OutputType::BECH32M);
305305
306306 LOCK (cs_KeyStore);
307307 if (!CanGetAddresses (internal)) {
308- error = _ (" Error: Keypool ran out, please call keypoolrefill first" ). translated ;
308+ error = _ (" Error: Keypool ran out, please call keypoolrefill first" );
309309 return false ;
310310 }
311311
312312 if (!ReserveKeyFromKeyPool (index, keypool, internal)) {
313- error = _ (" Error: Keypool ran out, please call keypoolrefill first" ). translated ;
313+ error = _ (" Error: Keypool ran out, please call keypoolrefill first" );
314314 return false ;
315315 }
316316 address = GetDestinationForKey (keypool.vchPubKey , type);
@@ -1613,11 +1613,11 @@ std::set<CKeyID> LegacyScriptPubKeyMan::GetKeys() const
16131613 return set_address;
16141614}
16151615
1616- bool DescriptorScriptPubKeyMan::GetNewDestination (const OutputType type, CTxDestination& dest, std::string & error)
1616+ bool DescriptorScriptPubKeyMan::GetNewDestination (const OutputType type, CTxDestination& dest, bilingual_str & error)
16171617{
16181618 // Returns true if this descriptor supports getting new addresses. Conditions where we may be unable to fetch them (e.g. locked) are caught later
16191619 if (!CanGetAddresses ()) {
1620- error = " No addresses available" ;
1620+ error = _ ( " No addresses available" ) ;
16211621 return false ;
16221622 }
16231623 {
@@ -1636,12 +1636,12 @@ bool DescriptorScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDest
16361636 std::vector<CScript> scripts_temp;
16371637 if (m_wallet_descriptor.range_end <= m_max_cached_index && !TopUp (1 )) {
16381638 // We can't generate anymore keys
1639- error = " Error: Keypool ran out, please call keypoolrefill first" ;
1639+ error = _ ( " Error: Keypool ran out, please call keypoolrefill first" ) ;
16401640 return false ;
16411641 }
16421642 if (!m_wallet_descriptor.descriptor ->ExpandFromCache (m_wallet_descriptor.next_index , m_wallet_descriptor.cache , scripts_temp, out_keys)) {
16431643 // We can't generate anymore keys
1644- error = " Error: Keypool ran out, please call keypoolrefill first" ;
1644+ error = _ ( " Error: Keypool ran out, please call keypoolrefill first" ) ;
16451645 return false ;
16461646 }
16471647
@@ -1721,7 +1721,7 @@ bool DescriptorScriptPubKeyMan::Encrypt(const CKeyingMaterial& master_key, Walle
17211721 return true ;
17221722}
17231723
1724- bool DescriptorScriptPubKeyMan::GetReservedDestination (const OutputType type, bool internal, CTxDestination& address, int64_t & index, CKeyPool& keypool, std::string & error)
1724+ bool DescriptorScriptPubKeyMan::GetReservedDestination (const OutputType type, bool internal, CTxDestination& address, int64_t & index, CKeyPool& keypool, bilingual_str & error)
17251725{
17261726 LOCK (cs_desc_man);
17271727 bool result = GetNewDestination (type, address, error);
0 commit comments