MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetReservedDestination

Method GetReservedDestination

src/wallet/scriptpubkeyman.cpp:306–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306bool LegacyScriptPubKeyMan::GetReservedDestination(const OutputType type, bool internal, CTxDestination& address, int64_t& index, CKeyPool& keypool, bilingual_str& error)
307{
308 if (LEGACY_OUTPUT_TYPES.count(type) == 0) {
309 error = _("Error: Legacy wallets only support the \"legacy\", \"p2sh-segwit\", and \"bech32\" address types");
310 return false;
311 }
312 assert(type != OutputType::BECH32M);
313
314 LOCK(cs_KeyStore);
315 if (!CanGetAddresses(internal)) {
316 error = _("Error: Keypool ran out, please call keypoolrefill first");
317 return false;
318 }
319
320 if (!ReserveKeyFromKeyPool(index, keypool, internal)) {
321 error = _("Error: Keypool ran out, please call keypoolrefill first");
322 return false;
323 }
324 address = GetDestinationForKey(keypool.vchPubKey, type);
325 return true;
326}
327
328bool LegacyScriptPubKeyMan::TopUpInactiveHDChain(const CKeyID seed_id, int64_t index, bool internal)
329{

Callers

nothing calls this directly

Calls 3

_Function · 0.85
GetDestinationForKeyFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected