| 22 | const uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000; |
| 23 | |
| 24 | bool LegacyScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDestination& dest, bilingual_str& error) |
| 25 | { |
| 26 | if (LEGACY_OUTPUT_TYPES.count(type) == 0) { |
| 27 | error = _("Error: Legacy wallets only support the \"legacy\", \"p2sh-segwit\", and \"bech32\" address types"); |
| 28 | return false; |
| 29 | } |
| 30 | assert(type != OutputType::BECH32M); |
| 31 | |
| 32 | LOCK(cs_KeyStore); |
| 33 | error.clear(); |
| 34 | |
| 35 | // Generate a new key that is added to wallet |
| 36 | CPubKey new_key; |
| 37 | if (!GetKeyFromPool(new_key, type)) { |
| 38 | error = _("Error: Keypool ran out, please call keypoolrefill first"); |
| 39 | return false; |
| 40 | } |
| 41 | LearnRelatedScripts(new_key, type); |
| 42 | dest = GetDestinationForKey(new_key, type); |
| 43 | |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | typedef std::vector<unsigned char> valtype; |
| 48 |
nothing calls this directly
no test coverage detected