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

Method GetReservedDestination

src/wallet/wallet.cpp:2583–2604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2581}
2582
2583bool ReserveDestination::GetReservedDestination(CTxDestination& dest, bool internal, bilingual_str& error)
2584{
2585 m_spk_man = pwallet->GetScriptPubKeyMan(type, internal);
2586 if (!m_spk_man) {
2587 error = strprintf(_("Error: No %s addresses available."), FormatOutputType(type));
2588 return false;
2589 }
2590
2591
2592 if (nIndex == -1)
2593 {
2594 m_spk_man->TopUp();
2595
2596 CKeyPool keypool;
2597 if (!m_spk_man->GetReservedDestination(type, internal, address, nIndex, keypool, error)) {
2598 return false;
2599 }
2600 fInternal = keypool.fInternal;
2601 }
2602 dest = address;
2603 return true;
2604}
2605
2606void ReserveDestination::SetBlindingPubKey(const CPubKey& blinding_pubkey, CTxDestination& dest)
2607{

Callers 2

spend.cppFile · 0.45

Calls 3

_Function · 0.85
GetScriptPubKeyManMethod · 0.80
TopUpMethod · 0.45

Tested by

no test coverage detected